From 3ad70983ddab77a2d1d1e4b10623a8be393dc8f4 Mon Sep 17 00:00:00 2001 From: timwe Date: Sun, 29 Dec 2024 03:19:33 +0100 Subject: [PATCH] check denied players: allow trusted or helper players --- .../ovis/futureplots/listener/plot/PlayerMove.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/ovis/futureplots/listener/plot/PlayerMove.java b/src/main/java/ovis/futureplots/listener/plot/PlayerMove.java index f604e00..601c180 100644 --- a/src/main/java/ovis/futureplots/listener/plot/PlayerMove.java +++ b/src/main/java/ovis/futureplots/listener/plot/PlayerMove.java @@ -50,9 +50,14 @@ public void on(PlayerMoveEvent event) { final Plot plotTo = plotManager.getMergedPlot(event.getTo().getFloorX(), event.getTo().getFloorZ()); if(plotTo != null) { - if(!plotTo.isOwner(player.getUniqueId()) && (plotTo.isDenied(player.getUniqueId()) || plotTo.isDenied(Utils.UUID_EVERYONE)) && !player.hasPermission("plot.admin.bypass.deny")) { - event.setCancelled(true); - return; + if(plotTo.isDenied(player.getUniqueId()) || plotTo.isDenied(Utils.UUID_EVERYONE)) { + Player owner = this.plugin.getServer().getPlayer(this.plugin.getCorrectName(plotTo.getOwner())); + if (!plotTo.isOwner(player.getUniqueId()) && !plotTo.isTrusted(player.getUniqueId()) && !player.hasPermission("plot.admin.bypass.deny")) { + if ((plotTo.isHelper(player.getUniqueId()) && owner == null) || !plotTo.isHelper(player.getUniqueId())) { + event.setCancelled(true); + return; + } + } } if(plotFrom == null) {