From 4e391136c0a67c44d877cac05a7e7f02e188f558 Mon Sep 17 00:00:00 2001 From: Xaver106 <46501008+Xaver106@users.noreply.github.com> Date: Fri, 15 Oct 2021 12:28:23 +0200 Subject: [PATCH] Add and Trust permission now count correctly (#3290) --- Core/src/main/java/com/plotsquared/core/command/Add.java | 2 +- Core/src/main/java/com/plotsquared/core/command/Deny.java | 2 +- Core/src/main/java/com/plotsquared/core/command/Trust.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/command/Add.java b/Core/src/main/java/com/plotsquared/core/command/Add.java index 30ac637b9..a87bb4206 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Add.java +++ b/Core/src/main/java/com/plotsquared/core/command/Add.java @@ -132,7 +132,7 @@ public class Add extends Command { checkTrue(!uuids.isEmpty(), null); int localAddSize = plot.getMembers().size(); int maxAddSize = Permissions.hasPermissionRange(player, Permission.PERMISSION_ADD, Settings.Limit.MAX_PLOTS); - if (localAddSize > maxAddSize) { + if (localAddSize >= maxAddSize) { player.sendMessage( TranslatableCaption.of("members.plot_max_members_added"), Template.of("amount", String.valueOf(localAddSize)) diff --git a/Core/src/main/java/com/plotsquared/core/command/Deny.java b/Core/src/main/java/com/plotsquared/core/command/Deny.java index 3c16bddd8..0e99d18c0 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Deny.java +++ b/Core/src/main/java/com/plotsquared/core/command/Deny.java @@ -94,7 +94,7 @@ public class Deny extends SubCommand { int maxDenySize = Permissions.hasPermissionRange(player, Permission.PERMISSION_DENY, Settings.Limit.MAX_PLOTS); int size = plot.getDenied().size(); - if (size > (maxDenySize - 1)) { + if (size >= maxDenySize) { player.sendMessage( TranslatableCaption.of("members.plot_max_members_denied"), Template.of("amount", String.valueOf(size)) diff --git a/Core/src/main/java/com/plotsquared/core/command/Trust.java b/Core/src/main/java/com/plotsquared/core/command/Trust.java index 667643407..e161bdf49 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Trust.java +++ b/Core/src/main/java/com/plotsquared/core/command/Trust.java @@ -138,7 +138,7 @@ public class Trust extends Command { checkTrue(!uuids.isEmpty(), null); int localTrustSize = currentPlot.getTrusted().size(); int maxTrustSize = Permissions.hasPermissionRange(player, Permission.PERMISSION_TRUST, Settings.Limit.MAX_PLOTS); - if (localTrustSize > maxTrustSize) { + if (localTrustSize >= maxTrustSize) { player.sendMessage( TranslatableCaption.of("members.plot_max_members_trusted"), Template.of("amount", String.valueOf(localTrustSize))