diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulator.java b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulator.java index 16fc4c84..c2b37750 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulator.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulator.java @@ -249,6 +249,9 @@ public class TNTSimulator { AtomicInteger currentTick = new AtomicInteger(0); Bukkit.getScheduler().runTaskTimer(BauSystem.getInstance(), bukkitTask -> { int tick = currentTick.get(); + if (tick > maxTick.get()) bukkitTask.cancel(); + currentTick.incrementAndGet(); + List>> toSpawnInTick = toSpawn.get(tick); if (toSpawnInTick == null) return; toSpawnInTick.forEach(pairs -> { @@ -264,8 +267,6 @@ public class TNTSimulator { }); } }); - if (tick > maxTick.get()) bukkitTask.cancel(); - currentTick.incrementAndGet(); }, 1, 1); } }