From 292907b73572ad5299a4d7d28e67c12c494fe3ab Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 18 Sep 2023 17:26:44 +0200 Subject: [PATCH] Fix TestblockCommand permission Fix XrayCommand destroy block on right click Signed-off-by: yoyosource --- .../de/steamwar/bausystem/features/region/TestblockCommand.java | 2 +- .../src/de/steamwar/bausystem/features/xray/XrayCommand.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java index 132e7cac..cd261125 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/TestblockCommand.java @@ -159,7 +159,7 @@ public class TestblockCommand extends SWCommand { @ClassValidator(value = Player.class, local = true) public TypeValidator validator() { - return (commandSender, player, messageSender) -> !messageSender.send(!Permission.hasPermission(player, Permission.WORLD), "REGION_TB_NO_PERMS"); + return (commandSender, player, messageSender) -> !messageSender.send(!Permission.hasPermission(player, Permission.WORLDEDIT), "REGION_TB_NO_PERMS"); } private Region regionCheck(Player player) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/xray/XrayCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/xray/XrayCommand.java index 1a9387c6..ff466080 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/xray/XrayCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/xray/XrayCommand.java @@ -131,6 +131,7 @@ public class XrayCommand extends SWCommand implements Listener, ScoreboardElemen @EventHandler public void onPlayerInteract(PlayerInteractEvent event) { if (event.getAction() != Action.RIGHT_CLICK_BLOCK) return; + if (!event.hasItem() || event.getItem().getType().isAir()) return; Region region = Region.getRegion(event.getPlayer().getLocation()); if (!(hidden.containsKey(region) && hidden.get(region).contains(event.getPlayer()))) { return;