From 387977210353cea78349bcd0163ae1cf6a283cdf Mon Sep 17 00:00:00 2001 From: wizjany Date: Tue, 17 Nov 2020 16:36:36 -0500 Subject: [PATCH] Move /rg bypass perm check inside the command. Using @CommandPermissions would cause the root command to be excluded from the client. This is a temp workaround until piston/proper perms are somehow implemented. --- .../com/sk89q/worldguard/commands/region/RegionCommands.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/worldguard-core/src/main/java/com/sk89q/worldguard/commands/region/RegionCommands.java b/worldguard-core/src/main/java/com/sk89q/worldguard/commands/region/RegionCommands.java index 9c50b117..da824983 100644 --- a/worldguard-core/src/main/java/com/sk89q/worldguard/commands/region/RegionCommands.java +++ b/worldguard-core/src/main/java/com/sk89q/worldguard/commands/region/RegionCommands.java @@ -1125,9 +1125,11 @@ public void teleport(CommandContext args, Actor sender) throws CommandException @Command(aliases = {"toggle-bypass", "bypass"}, desc = "Toggle region bypassing, effectively ignoring bypass permissions.") - @CommandPermissions({"worldguard.region.toggle-bypass"}) public void toggleBypass(CommandContext args, Actor sender) throws CommandException { LocalPlayer player = worldGuard.checkPlayer(sender); + if (!player.hasPermission("worldguard.region.toggle-bypass")) { + throw new CommandPermissionsException(); + } Session session = WorldGuard.getInstance().getPlatform().getSessionManager().get(player); if (session.hasBypassDisabled()) { session.setBypassDisabled(false);