diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java index 02066909..815b238d 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java @@ -49,6 +49,7 @@ public class CraftScheduler implements BukkitScheduler, Runnable { long firstTick = -1; long currentTick = -1; CraftTask first = null; + TreeMap<CraftTask, Boolean> nextQueue = new TreeMap<CraftTask, Boolean>(); do { synchronized (schedulerQueue) { first = null; @@ -64,7 +65,7 @@ public class CraftScheduler implements BukkitScheduler, Runnable { processTask(first); if (first.getPeriod() >= 0) { first.updateExecution(); - schedulerQueue.put(first, first.isSync()); + nextQueue.put(first, first.isSync()); } } else { stop = true; @@ -78,6 +79,10 @@ public class CraftScheduler implements BukkitScheduler, Runnable { } } while (!stop); + synchronized (schedulerQueue) { + schedulerQueue.putAll(nextQueue); + } + long sleepTime = 0; if (first == null) { sleepTime = 60000L; |