Add plots.visit.denied permission

This commit is contained in:
N0tMyFaultOG 2020-11-01 22:16:23 +01:00 committed by dordsor21
parent 7a203a12a3
commit 5b11175cf3
3 changed files with 10 additions and 0 deletions

View File

@ -141,6 +141,8 @@ permissions:
default: false default: false
plots.visit.other: plots.visit.other:
default: false default: false
plots.visit.denied:
default: false
plots.home: plots.home:
default: false default: false
plots.alias.remove: plots.alias.remove:

View File

@ -135,6 +135,13 @@ public class Visit extends Command {
Templates.of("node", "plots.admin.visit.untrusted")); Templates.of("node", "plots.admin.visit.untrusted"));
return; return;
} }
if (plot.isDenied(player.getUUID())) {
if (!Permissions.hasPermission(player, Permission.PERMISSION_VISIT_DENIED)) {
player.sendMessage(TranslatableCaption.of("permission.no_permission"),
Template.of("node", "plots.visit.denied"));
return;
}
}
} }
confirm.run(this, () -> plot.teleportPlayer(player, TeleportCause.COMMAND, result -> { confirm.run(this, () -> plot.teleportPlayer(player, TeleportCause.COMMAND, result -> {

View File

@ -147,6 +147,7 @@ public enum Permission {
PERMISSION_VISIT_UNOWNED("plots.visit.unowned"), PERMISSION_VISIT_UNOWNED("plots.visit.unowned"),
PERMISSION_VISIT_OWNED("plots.visit.owned"), PERMISSION_VISIT_OWNED("plots.visit.owned"),
PERMISSION_SHARED("plots.visit.shared"), PERMISSION_SHARED("plots.visit.shared"),
PERMISSION_VISIT_DENIED("plots.visit.denied"),
PERMISSION_VISIT_OTHER("plots.visit.other"), PERMISSION_VISIT_OTHER("plots.visit.other"),
PERMISSION_HOME("plots.home"), PERMISSION_HOME("plots.home"),
PERMISSION_ALIAS_SET("plots.alias.set"), PERMISSION_ALIAS_SET("plots.alias.set"),