mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +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",
|
@CommandDeclaration(command = "deny",
|
||||||
aliases = {"d", "ban"},
|
aliases = {"d", "ban"},
|
||||||
usage = "/plot deny <player | *>",
|
usage = "/plot deny <player",
|
||||||
category = CommandCategory.SETTINGS,
|
category = CommandCategory.SETTINGS,
|
||||||
requiredType = RequiredType.PLAYER)
|
requiredType = RequiredType.PLAYER)
|
||||||
public class Deny extends SubCommand {
|
public class Deny extends SubCommand {
|
||||||
@ -76,9 +76,7 @@ public class Deny extends SubCommand {
|
|||||||
public boolean onCommand(PlotPlayer<?> player, String[] args) {
|
public boolean onCommand(PlotPlayer<?> player, String[] args) {
|
||||||
|
|
||||||
Location location = player.getLocation();
|
Location location = player.getLocation();
|
||||||
Plot plot = location.getPlotAbs();
|
final Plot plot = location.getPlotAbs();
|
||||||
final Plot currentPlot = player.getCurrentPlot();
|
|
||||||
int size = currentPlot.getDenied().size();
|
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
player.sendMessage(TranslatableCaption.of("errors.not_in_plot"));
|
player.sendMessage(TranslatableCaption.of("errors.not_in_plot"));
|
||||||
return false;
|
return false;
|
||||||
@ -94,6 +92,7 @@ public class Deny extends SubCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int maxDenySize = Permissions.hasPermissionRange(player, Permission.PERMISSION_DENY, Settings.Limit.MAX_PLOTS);
|
int maxDenySize = Permissions.hasPermissionRange(player, Permission.PERMISSION_DENY, Settings.Limit.MAX_PLOTS);
|
||||||
|
int size = plot.getDenied().size();
|
||||||
if (size > (maxDenySize - 1)) {
|
if (size > (maxDenySize - 1)) {
|
||||||
player.sendMessage(
|
player.sendMessage(
|
||||||
TranslatableCaption.of("members.plot_max_members_denied"),
|
TranslatableCaption.of("members.plot_max_members_denied"),
|
||||||
|
Loading…
Reference in New Issue
Block a user