From d5f4503e087371e4370c91a88b6cacef8832bdfb Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 30 Jul 2022 11:29:38 +0200 Subject: [PATCH] Fix FreezeListener Signed-off-by: yoyosource --- BauSystem_Main/src/BauSystem.properties | 6 ++++++ .../steamwar/bausystem/features/region/FreezeListener.java | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index c558fe10..192c5488 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -1272,3 +1272,9 @@ TECHHIDER_HELP = §8/§etechhider §8- §7Toggle Techhider TECHHIDER_GLOBAL = §cNo techhider in global region TECHHIDER_ON = §aTechhider activated TECHHIDER_OFF = §aTechhider deactivated + +# XRAY +XRAY_HELP = §8/§exray §8- §7Toggle Xray +XRAY_GLOBAL = §cNo xray in global region +XRAY_ON = §aXray activated +XRAY_OFF = §aXray deactivated diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/FreezeListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/FreezeListener.java index 3b8d7c69..eb3b5a05 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/FreezeListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/FreezeListener.java @@ -103,7 +103,7 @@ public class FreezeListener implements Listener { @EventHandler public void onBlockBreak(BlockBreakEvent e) { if (Core.getVersion() < 19) return; - if (e.getPlayer().getItemInUse() != null && e.getPlayer().getItemInUse().getType() == Material.DEBUG_STICK) return; + if (e.getPlayer().getInventory().getItemInMainHand().getType() == Material.DEBUG_STICK) return; if (Region.getRegion(e.getBlock().getLocation()).get(Flag.FREEZE) == FreezeMode.ACTIVE) { e.setCancelled(true); e.getBlock().setType(Material.AIR, false);