Near exclude permission

This commit is contained in:
pop4959 2020-03-04 23:23:23 -08:00
parent c10b39c1c7
commit 98239114ad
2 changed files with 4 additions and 1 deletions

View File

@ -88,7 +88,7 @@ public class Commandnear extends EssentialsCommand {
Queue<User> nearbyPlayers = new PriorityQueue<>((o1, o2) -> (int) (o1.getLocation().distanceSquared(loc) - o2.getLocation().distanceSquared(loc)));
for (User player : ess.getOnlineUsers()) {
if (!player.equals(user) && (!player.isHidden(user.getBase()) || showHidden || user.getBase().canSee(player.getBase()))) {
if (!player.equals(user) && !player.getBase().hasPermission("essentials.near.exclude") && (!player.isHidden(user.getBase()) || showHidden || user.getBase().canSee(player.getBase()))) {
final Location playerLoc = player.getLocation();
if (playerLoc.getWorld() != world) {
continue;

View File

@ -564,3 +564,6 @@ permissions:
essentials.keepinv:
default: false
description: Controls whether players keep their inventory on death.
essentials.near.exclude:
default: false
description: If the player should be excluded from near lookups.