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 fb6a91cd..f9513cd4 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulator.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulator.java @@ -117,6 +117,10 @@ public class TNTSimulator { return tntSpawns; } + public void clear() { + new ArrayList<>(tntElementList).forEach(this::remove); + } + public void remove(SimulatorElement element) { if (element instanceof TNTElement) { TNTElement tntElement = (TNTElement) element; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/gui/TNTSimulatorGui.java b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/gui/TNTSimulatorGui.java index aed364bc..e813580a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/gui/TNTSimulatorGui.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/gui/TNTSimulatorGui.java @@ -130,7 +130,7 @@ public class TNTSimulatorGui { inv.setItem(51, new SWItem(Material.BARRIER, BauSystem.MESSAGE.parse("SIMULATOR_GUI_DELETE", player), clickType -> { if (currentTntSimulator != null) { currentTntSimulator.getTntElementList().forEach(SimulatorElement::close); - currentTntSimulator.getTntElementList().clear(); + currentTntSimulator.clear(); player.closeInventory(); } else { TNTSimulator tntSimulator = SimulatorStorage.getSimulator(player);