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 f7db47b2..29d4ea38 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulator.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulator.java @@ -75,8 +75,8 @@ public class TNTSimulator { }); } - public void saveAndDelete() { - TNTSimulator simulator = TNT_SIMULATOR_MAP.remove(player); + public void save() { + TNTSimulator simulator = TNT_SIMULATOR_MAP.get(player); YAPIONArray yapionArray = new YAPIONArray(); simulator.spawns.forEach(tntSpawn -> { yapionArray.add(tntSpawn.output()); @@ -90,6 +90,11 @@ public class TNTSimulator { simulator.hide(); } + public void saveAndDelete() { + save(); + TNT_SIMULATOR_MAP.remove(player); + } + public void delete() { TNTSimulator simulator = TNT_SIMULATOR_MAP.remove(player); WorldData.getSimulatorData().remove(SteamwarUser.get(player.getUniqueId()).getId() + ""); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java index 8a93e29f..b85ed1b2 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java @@ -147,7 +147,7 @@ public class TNTSimulatorListener implements Listener, Disable { @Override public void disable() { for (TNTSimulator simulator : TNTSimulator.TNT_SIMULATOR_MAP.values()) { - simulator.saveAndDelete(); + simulator.save(); } } }