fix: Untrusted visit flag not working with untrusted visit permission

Fixes #3317 
Co-authored-by: Alex <mc.cache@web.de>
This commit is contained in:
mindw0rm 2021-11-02 14:28:39 +01:00 committed by GitHub
parent e99c4e3289
commit 7263290bbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -140,21 +140,16 @@ public class Visit extends Command {
return;
}
} else {
if (!Permissions.hasPermission(player, Permission.PERMISSION_VISIT_OTHER)) {
// allow visit, if UntrustedVisit flag is set, or if the player has either the plot.visit.other or
// plot.admin.visit.untrusted permission
if (!plot.getFlag(UntrustedVisitFlag.class) && !Permissions.hasPermission(player, Permission.PERMISSION_VISIT_OTHER)
&& !Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_VISIT_UNTRUSTED)) {
player.sendMessage(
TranslatableCaption.of("permission.no_permission"),
Templates.of("node", "plots.visit.other")
);
return;
}
if (!plot.getFlag(UntrustedVisitFlag.class) && !Permissions
.hasPermission(player, Permission.PERMISSION_ADMIN_VISIT_UNTRUSTED)) {
player.sendMessage(
TranslatableCaption.of("permission.no_permission"),
Templates.of("node", "plots.admin.visit.untrusted")
);
return;
}
if (plot.isDenied(player.getUUID())) {
if (!Permissions.hasPermission(player, Permission.PERMISSION_VISIT_DENIED)) {
player.sendMessage(