diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java index 298c972455..334013a13d 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 itr = schedulerQueue.keySet().iterator(); + while (itr.hasNext()) { + CraftTask current = itr.next(); + if (current.getIdNumber() == taskId) { + return true; + } + } + return false; + } + } + }