SteamWar/BauSystem2.0
Archiviert
12
0

Fix TNTSimulator not working
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2022-06-11 22:40:54 +02:00
Ursprung dc8d9ccf4b
Commit f75efee1ab

Datei anzeigen

@ -249,6 +249,9 @@ public class TNTSimulator {
AtomicInteger currentTick = new AtomicInteger(0); AtomicInteger currentTick = new AtomicInteger(0);
Bukkit.getScheduler().runTaskTimer(BauSystem.getInstance(), bukkitTask -> { Bukkit.getScheduler().runTaskTimer(BauSystem.getInstance(), bukkitTask -> {
int tick = currentTick.get(); int tick = currentTick.get();
if (tick > maxTick.get()) bukkitTask.cancel();
currentTick.incrementAndGet();
List<List<Pair<Runnable, Integer>>> toSpawnInTick = toSpawn.get(tick); List<List<Pair<Runnable, Integer>>> toSpawnInTick = toSpawn.get(tick);
if (toSpawnInTick == null) return; if (toSpawnInTick == null) return;
toSpawnInTick.forEach(pairs -> { toSpawnInTick.forEach(pairs -> {
@ -264,8 +267,6 @@ public class TNTSimulator {
}); });
} }
}); });
if (tick > maxTick.get()) bukkitTask.cancel();
currentTick.incrementAndGet();
}, 1, 1); }, 1, 1);
} }
} }