From 3f4f237d63e6ddd2f75d3c22ed34a75c01d3fe21 Mon Sep 17 00:00:00 2001 From: PsiRobot Date: Thu, 23 Mar 2023 22:27:51 +0000 Subject: [PATCH 1/2] Fixed Issue #110 Loader bugt bei Strings --- .../de/steamwar/bausystem/features/loader/Loader.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/loader/Loader.java b/BauSystem_Main/src/de/steamwar/bausystem/features/loader/Loader.java index 8c12f2de..1a64a8af 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/loader/Loader.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/loader/Loader.java @@ -38,6 +38,7 @@ import org.bukkit.event.block.Action; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.inventory.EquipmentSlot; import org.bukkit.scheduler.BukkitTask; import java.util.*; @@ -201,8 +202,18 @@ public class Loader implements Listener { if (event.getAction() != Action.RIGHT_CLICK_BLOCK && event.getAction() != Action.PHYSICAL) return; + if (event.getClickedBlock().getType() == Material.OBSERVER) return; + + if (event.getHand() == EquipmentSlot.OFF_HAND) { + return; + } + + if (event.getPlayer().getInventory().getItemInMainHand().getType() == Material.TNT) { + return; + } + LoaderButton button = LoaderButton.fromBlock(event.getClickedBlock()); if (button != LoaderButton.INVALID) { actions.add(InteractionActivation.construct(p, event.getClickedBlock().getLocation(), this)); From f1925dc366ec73117bea4f032e0bd073ecc8d46a Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Sun, 30 Apr 2023 14:20:37 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=E2=80=9EBauSystem=5FMain/src/de/steamwar/b?= =?UTF-8?q?ausystem/features/loader/Loader.java=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/de/steamwar/bausystem/features/loader/Loader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/loader/Loader.java b/BauSystem_Main/src/de/steamwar/bausystem/features/loader/Loader.java index 1a64a8af..6cba6fe9 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/loader/Loader.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/loader/Loader.java @@ -211,7 +211,7 @@ public class Loader implements Listener { } if (event.getPlayer().getInventory().getItemInMainHand().getType() == Material.TNT) { - return; + return; } LoaderButton button = LoaderButton.fromBlock(event.getClickedBlock());