mirror of
https://github.com/Brettflan/WorldBorder.git
synced 2025-01-09 17:37:39 +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;
|
return null;
|
||||||
|
|
||||||
// if player has "worldborder.bypass" permission, allow them beyond border
|
// if player has "worldborder.bypass" permission, allow them beyond border
|
||||||
if (Config.HasPermission(player, "bypass"))
|
if (Config.HasPermission(player, "bypass", false))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
Location newLoc = newLocation(player, loc, border);
|
Location newLoc = newLocation(player, loc, border);
|
||||||
|
@ -280,6 +280,10 @@ public class Config
|
|||||||
|
|
||||||
|
|
||||||
public static boolean HasPermission(Player player, String request)
|
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
|
if (player == null) // console, always permitted
|
||||||
return true;
|
return true;
|
||||||
@ -287,7 +291,9 @@ public class Config
|
|||||||
if (player.hasPermission("worldborder." + request)) // built-in Bukkit superperms
|
if (player.hasPermission("worldborder." + request)) // built-in Bukkit superperms
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
player.sendMessage("You do not have sufficient permissions.");
|
if (notify)
|
||||||
|
player.sendMessage("You do not have sufficient permissions.");
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,4 +107,4 @@ permissions:
|
|||||||
default: op
|
default: op
|
||||||
worldborder.bypass:
|
worldborder.bypass:
|
||||||
description: Can go beyond the border without being knocked back
|
description: Can go beyond the border without being knocked back
|
||||||
default: none
|
default: false
|
||||||
|
Loading…
Reference in New Issue
Block a user