Skip to content

Commit

Permalink
check denied players: allow trusted or helper players
Browse files Browse the repository at this point in the history
  • Loading branch information
tim03we committed Dec 29, 2024
1 parent 7609cd3 commit 3ad7098
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/java/ovis/futureplots/listener/plot/PlayerMove.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 3ad7098

Please sign in to comment.