From 202e03c957a812532974fe5a7c52e6918e3f5f8e Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 22 Dec 2023 10:03:24 +0100 Subject: [PATCH] Fix SmartPlaceListener --- .../features/smartplace/SmartPlaceListener.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/SmartPlaceListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/SmartPlaceListener.java index 61b69c31..b079d224 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/SmartPlaceListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/smartplace/SmartPlaceListener.java @@ -73,6 +73,7 @@ public class SmartPlaceListener implements Plain, Listener { IGNORED.add(Material.TNT); IGNORED.add(Material.REDSTONE_ORE); IGNORED.add(SWItem.getMaterial("BEEHIVE")); + IGNORED.add(SWItem.getMaterial("SEA_PICKLE")); IGNORED.remove(Material.STONE); IGNORED.remove(Material.BARRIER); } @@ -92,7 +93,18 @@ public class SmartPlaceListener implements Plain, Listener { TinyProtocol.instance.addFilter(useItem, (player, packet) -> { if (!Config.getInstance().get(player).getPlainValueOrDefault("smartPlace", false)) return packet; Block block = player.getTargetBlockExact(6); - boolean shouldSneak = !(block != null && (block.getType().isInteractable() || block.getType() == Material.NOTE_BLOCK) && !CONTAINERS.contains(block.getType()) && !IGNORED.contains(block.getType())); + boolean shouldSneak = false; + if (block != null) { + if (block.getType().isInteractable() || block.getType() == Material.NOTE_BLOCK) { + shouldSneak = true; + } + if (!CONTAINERS.contains(block.getType())) { + shouldSneak = false; + } + if (IGNORED.contains(block.getType())) { + shouldSneak = false; + } + } boolean sneaking = player.isSneaking(); run(player, packet, true, sneaking, shouldSneak); return null;