SHOW:
|
|
- or go back to the newest paste.
1 | public class ArrowRemoval { | |
2 | ||
3 | public ArrowRemoval(){ | |
4 | enable(); | |
5 | } | |
6 | ||
7 | public static PriorityQueue<ArrowLandData> q = new PriorityQueue<ArrowLandData>(); | |
8 | ||
9 | public void enable(){ | |
10 | - | Plugin.getInstance().getServer().getScheduler().scheduleSyncRepeatingTask(Plugin.getInstance(), new Runnable(){ |
10 | + | plugin.getInstance().getServer().getScheduler().scheduleSyncRepeatingTask(plugin.getInstance(), new Runnable(){ |
11 | ||
12 | @Override | |
13 | public void run() { | |
14 | - | if(q.peek().getArrow().isValid())q.peek().getArrow().remove(); |
14 | + | ArrowLandData a = q.peek(); |
15 | if(a.getTime() / 1000 >= 10 && a.getArrow().isValid()){ | |
16 | a.getArrow(); | |
17 | q.remove(a); | |
18 | } | |
19 | ||
20 | } | |
21 | }, 100L, 100L); | |
22 | } | |
23 | ||
24 | } |