diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCursor.java b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCursor.java index caa3af54..e8fc1bac 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCursor.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCursor.java @@ -79,6 +79,16 @@ public class SimulatorCursor { BauSystem.MESSAGE.sendPrefixless("SIMULATOR_POSITION_ADD", player, ChatMessageType.ACTION_BAR); } + public void hide(Player player) { + REntityServer cursor = rEntityServerMap.get(player); + if (cursor == null) return; + + cursor.close(); + SimulatorStorage.getSimulatorNames().forEach(s -> { + SimulatorStorage.getSimulator(s).hide(player); + }); + } + public void hide(Player player, TNTSimulator tntSimulator) { REntityServer cursor = rEntityServerMap.get(player); 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 19fea2cc..a3862c9f 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java @@ -55,7 +55,7 @@ public class TNTSimulatorListener implements Listener { if (ItemUtils.isItem(e.getPlayer().getInventory().getItemInMainHand(), "simulator")) { simulatorShowHide(e.getPlayer(), i -> null, PlayerInventory::getItemInMainHand, e.getTo()); } else { - simulatorShowHide(e.getPlayer(), i -> null, i -> null, e.getTo()); + SimulatorCursor.hide(e.getPlayer()); } }