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.
This commit is contained in:
parent
48233c3327
commit
3879772103
|
@ -1125,9 +1125,11 @@ public final class RegionCommands extends RegionCommandsBase {
|
|||
|
||||
@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);
|
||||
|
|
Loading…
Reference in New Issue