summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java14
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;
+ }
+ }
+
}