From 2166096ba55af0bc8c4773e48c680b1e980c076e Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Fri, 1 Aug 2025 21:17:58 +0200 Subject: [PATCH] Fix PistonCalculator --- .../steamwar/bausystem/features/util/PistonCalculator.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/util/PistonCalculator.java b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/util/PistonCalculator.java index 4479ff63..6bf9b0c9 100644 --- a/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/util/PistonCalculator.java +++ b/BauSystem/BauSystem_Main/src/de/steamwar/bausystem/features/util/PistonCalculator.java @@ -55,8 +55,9 @@ public class PistonCalculator implements Listener { public void onPlayerInteract(PlayerInteractEvent event) { if (!Permission.BUILD.hasPermission(event.getPlayer())) return; if (event.getAction() != Action.RIGHT_CLICK_BLOCK) return; - if (event.hasItem() && event.getItem().getType() == Material.SLIME_BALL) { - } else if (event.hasItem()) return; + if (event.getItem() == null) {} + else if (event.getItem() != null && event.getItem().getType() == Material.SLIME_BALL) {} + else return; if (event.getClickedBlock() == null) return; Block clickedBlock = event.getClickedBlock(); Material blockType = clickedBlock.getType();