From 27a8fcd739204c6ae9073939c7eaba8fe13d769b Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Thu, 9 Sep 2021 12:36:09 +0200 Subject: [PATCH] Plot location may be final --- Core/src/main/java/com/plotsquared/core/command/Deny.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 a0df81a0e..69d7b434c 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Deny.java +++ b/Core/src/main/java/com/plotsquared/core/command/Deny.java @@ -51,7 +51,7 @@ import java.util.concurrent.TimeoutException; @CommandDeclaration(command = "deny", aliases = {"d", "ban"}, - usage = "/plot deny ", + usage = "/plot deny player, String[] args) { Location location = player.getLocation(); - Plot plot = location.getPlotAbs(); - final Plot currentPlot = player.getCurrentPlot(); - int size = currentPlot.getDenied().size(); + final Plot plot = location.getPlotAbs(); if (plot == null) { player.sendMessage(TranslatableCaption.of("errors.not_in_plot")); return false; @@ -94,6 +92,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)) { player.sendMessage( TranslatableCaption.of("members.plot_max_members_denied"),