From f1f783f0ec745db8a69ca6f6521e6fc57e672edb Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 18 Jul 2022 16:15:53 +0200 Subject: [PATCH] Fix offhand simulator --- .../bausystem/features/simulator/TNTSimulatorListener.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 6a85a082..912e46fe 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/TNTSimulatorListener.java @@ -32,7 +32,6 @@ import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerItemHeldEvent; @@ -96,7 +95,11 @@ public class TNTSimulatorListener implements Listener { @EventHandler public void onPlayerMove(PlayerMoveEvent e) { - simulatorShowHide(e.getPlayer(), i -> null, PlayerInventory::getItemInMainHand, e.getTo()); + if (!ItemUtils.isItem(e.getPlayer().getInventory().getItemInMainHand(), "simulator")) { + simulatorShowHide(e.getPlayer(), i -> null, PlayerInventory::getItemInMainHand, e.getTo()); + } else { + simulatorShowHide(e.getPlayer(), i -> null, PlayerInventory::getItemInOffHand, e.getTo()); + } } @EventHandler