diff options
author | Andrew Ardill <andrew.ardill@gmail.com> | 2011-02-21 12:28:35 +1100 |
---|---|---|
committer | Andrew Ardill <andrew.ardill@gmail.com> | 2011-02-21 16:32:40 +1100 |
commit | 6269c1e633d6736cacc75c0a55f56fbf182fea88 (patch) | |
tree | 8c8bf595c73101b09d95dd7f429975ecd18906e3 | |
parent | 6335a5af76f6035dcd02ee97b8069c40048af903 (diff) | |
download | craftbukkit-6269c1e633d6736cacc75c0a55f56fbf182fea88.tar craftbukkit-6269c1e633d6736cacc75c0a55f56fbf182fea88.tar.gz craftbukkit-6269c1e633d6736cacc75c0a55f56fbf182fea88.tar.lz craftbukkit-6269c1e633d6736cacc75c0a55f56fbf182fea88.tar.xz craftbukkit-6269c1e633d6736cacc75c0a55f56fbf182fea88.zip |
implementation of isQueued()
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java index 298c9724..334013a1 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java @@ -223,4 +223,18 @@ public class CraftScheduler implements BukkitScheduler, Runnable { public boolean isCurrentlyRunning(int taskId){ return craftThreadManager.isAlive(taskId); } + + public boolean isQueued(int taskId) { + synchronized (schedulerQueue) { + Iterator<CraftTask> itr = schedulerQueue.keySet().iterator(); + while (itr.hasNext()) { + CraftTask current = itr.next(); + if (current.getIdNumber() == taskId) { + return true; + } + } + return false; + } + } + } |