mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 06:36:44 +01:00
Plot location may be final
This commit is contained in:
parent
c25a0c65a2
commit
27a8fcd739
@ -51,7 +51,7 @@ import java.util.concurrent.TimeoutException;
|
||||
|
||||
@CommandDeclaration(command = "deny",
|
||||
aliases = {"d", "ban"},
|
||||
usage = "/plot deny <player | *>",
|
||||
usage = "/plot deny <player",
|
||||
category = CommandCategory.SETTINGS,
|
||||
requiredType = RequiredType.PLAYER)
|
||||
public class Deny extends SubCommand {
|
||||
@ -76,9 +76,7 @@ public class Deny extends SubCommand {
|
||||
public boolean onCommand(PlotPlayer<?> 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"),
|
||||
|
Loading…
Reference in New Issue
Block a user