mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-21 20:56:45 +01:00
Handle plots.deny.<amount> properly
This commit is contained in:
parent
013e8fcda5
commit
c46647d491
@ -27,6 +27,7 @@ package com.plotsquared.core.command;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.plotsquared.core.PlotSquared;
|
||||
import com.plotsquared.core.configuration.Settings;
|
||||
import com.plotsquared.core.configuration.caption.TranslatableCaption;
|
||||
import com.plotsquared.core.database.DBFunc;
|
||||
import com.plotsquared.core.location.Location;
|
||||
@ -92,14 +93,13 @@ public class Deny extends SubCommand {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!(player.hasPermission("plots.deny." + size) || Permissions.hasPermission(
|
||||
player,
|
||||
Permission.PERMISSION_ADMIN_COMMAND_DENY
|
||||
))) {
|
||||
int maxDenySize = Permissions.hasPermissionRange(player, Permission.PERMISSION_DENY, Settings.Limit.MAX_PLOTS);
|
||||
if (size > (maxDenySize - 1)) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("members.plot_max_members_denied"),
|
||||
Template.of("amount", String.valueOf(size))
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
PlayerManager.getUUIDsFromString(args[0], (uuids, throwable) -> {
|
||||
|
@ -79,6 +79,7 @@ public enum Permission {
|
||||
PERMISSION_ADMIN_COMMAND_ADD("plots.admin.command.trust"),
|
||||
PERMISSION_ADMIN_COMMAND_TRUST("plots.admin.command.trust"),
|
||||
PERMISSION_TRUST("plots.trust"),
|
||||
PERMISSION_DENY("plots.deny"),
|
||||
PERMISSION_ADD("plots.add"),
|
||||
PERMISSION_TRUST_EVERYONE("plots.trust.everyone"),
|
||||
PERMISSION_AREA_CREATE("plots.area.create"),
|
||||
|
Loading…
Reference in New Issue
Block a user