mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-23 16:41:20 +01:00
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 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);
|
||||
|
Loading…
Reference in New Issue
Block a user