Fix untrusted-visit.

This commit is contained in:
Alexander Söderberg 2020-04-08 16:52:10 +02:00
parent ae2867136a
commit 4ca7a81e96
2 changed files with 7 additions and 2 deletions

View file

@ -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)) {

View file

@ -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"),