Skip to content

Commit

Permalink
Add "worldborder.allowbypass" permission (#10)
Browse files Browse the repository at this point in the history
While I was making the other PR I thought I might as well do this for @Prof-Bloodstone. Tested and works as expected. The perm is `worldborder.allowbypass` since `worldborder.bypass` is already used for the command.

Closes #8
  • Loading branch information
pop4959 committed Jul 1, 2021
1 parent 839f3da commit abb9329
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/wimbli/WorldBorder/BorderCheckTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static Location checkPlayer(Player player, Location targetLoc, boolean re
return null;

// if player is in bypass list (from bypass command), allow them beyond border; also ignore players currently being handled already
if (Config.isPlayerBypassing(player.getUniqueId()) || handlingPlayers.contains(player.getName().toLowerCase()))
if (Config.isPlayerBypassing(player.getUniqueId()) || player.hasPermission("worldborder.allowbypass") || handlingPlayers.contains(player.getName().toLowerCase()))
return null;

// tag this player as being handled so we can't get stuck in a loop due to Bukkit currently sometimes repeatedly providing incorrect location through teleport event
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,6 @@ permissions:
worldborder.wshape:
description: Can set an overriding border shape for a single world
default: op
worldborder.allowbypass:
description: Can allow a player to bypass the world border
default: false

0 comments on commit abb9329

Please sign in to comment.