From 4ca7a81e964e21a58a919cda858517a8d3c392c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20S=C3=B6derberg?= Date: Wed, 8 Apr 2020 16:52:10 +0200 Subject: [PATCH] Fix untrusted-visit. --- .../plotsquared/plot/commands/Visit.java | 8 ++++++-- .../plotsquared/plot/config/Captions.java | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java index 0e70d2acc..f9057307a 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java @@ -143,11 +143,15 @@ public class Visit extends Command { return CompletableFuture.completedFuture(false); } } else { - if (!Permissions.hasPermission(player, Captions.PERMISSION_VISIT_OTHER) && !plot - .getFlag(UntrustedVisitFlag.class)) { + if (!Permissions.hasPermission(player, Captions.PERMISSION_VISIT_OTHER)) { Captions.NO_PERMISSION.send(player, Captions.PERMISSION_VISIT_OTHER); return CompletableFuture.completedFuture(false); } + if (!plot.getFlag(UntrustedVisitFlag.class) && + !Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_VISIT_UNTRUSTED)) { + Captions.NO_PERMISSION.send(player, Captions.PERMISSION_ADMIN_VISIT_UNTRUSTED); + return CompletableFuture.completedFuture(false); + } } confirm.run(this, () -> { if (plot.teleportPlayer(player, TeleportCause.COMMAND)) { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Captions.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Captions.java index 366b33e4c..a8bc65c15 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Captions.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Captions.java @@ -53,6 +53,7 @@ public enum Captions implements Caption { PERMISSION_ADMIN_UPDATE_NOTIFICATION("plots.admin.update.notify", "static.permissions"), PERMISSION_ADMIN_EXIT_DENIED("plots.admin.exit.denied", "static.permissions"), PERMISSION_ADMIN_ENTRY_DENIED("plots.admin.entry.denied", "static.permissions"), + PERMISSION_ADMIN_VISIT_UNTRUSTED("plots.admin.visit.untrusted", "static.permissions"), PERMISSION_ADMIN_ENTRY_FORCEFIELD("plots.admin.entry.forcefield", "static.permissions"), PERMISSION_COMMANDS_CHAT("plots.admin.command.chat", "static.permissions"), PERMISSION_MERGE_OTHER("plots.merge.other", "static.permissions"),