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