mirror of
https://github.com/Brettflan/WorldBorder.git
synced 2025-01-08 17:08:09 +01:00
Polish up border bypass handling a bit
This commit is contained in:
parent
243e23f9a2
commit
28e5ea7019
@ -47,7 +47,7 @@ public class BorderCheckTask implements Runnable
|
||||
return null;
|
||||
|
||||
// if player has "worldborder.bypass" permission, allow them beyond border
|
||||
if (Config.HasPermission(player, "bypass"))
|
||||
if (Config.HasPermission(player, "bypass", false))
|
||||
return null;
|
||||
|
||||
Location newLoc = newLocation(player, loc, border);
|
||||
|
@ -280,6 +280,10 @@ public class Config
|
||||
|
||||
|
||||
public static boolean HasPermission(Player player, String request)
|
||||
{
|
||||
return HasPermission(player, request, true);
|
||||
}
|
||||
public static boolean HasPermission(Player player, String request, boolean notify)
|
||||
{
|
||||
if (player == null) // console, always permitted
|
||||
return true;
|
||||
@ -287,7 +291,9 @@ public class Config
|
||||
if (player.hasPermission("worldborder." + request)) // built-in Bukkit superperms
|
||||
return true;
|
||||
|
||||
player.sendMessage("You do not have sufficient permissions.");
|
||||
if (notify)
|
||||
player.sendMessage("You do not have sufficient permissions.");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -107,4 +107,4 @@ permissions:
|
||||
default: op
|
||||
worldborder.bypass:
|
||||
description: Can go beyond the border without being knocked back
|
||||
default: none
|
||||
default: false
|
||||
|
Loading…
Reference in New Issue
Block a user