mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-12-28 17:38:01 +01:00
Handle add & trust permission ranges properly
This commit is contained in:
parent
7898313b0b
commit
eb11d9e3aa
@ -130,11 +130,12 @@ public class Add extends Command {
|
||||
size += plot.getTrusted().contains(uuid) ? 0 : 1;
|
||||
}
|
||||
checkTrue(!uuids.isEmpty(), null);
|
||||
int localAddSize = plot.getMembers().size();
|
||||
int maxAddSize = Permissions.hasPermissionRange(player, Permission.PERMISSION_ADD, Settings.Limit.MAX_PLOTS);
|
||||
if (size > maxAddSize) {
|
||||
if (localAddSize > maxAddSize) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("members.plot_max_members_added"),
|
||||
Template.of("amount", String.valueOf(size - 1))
|
||||
Template.of("amount", String.valueOf(localAddSize))
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
@ -136,11 +136,12 @@ public class Trust extends Command {
|
||||
size += currentPlot.getMembers().contains(uuid) ? 0 : 1;
|
||||
}
|
||||
checkTrue(!uuids.isEmpty(), null);
|
||||
int localTrustSize = currentPlot.getTrusted().size();
|
||||
int maxTrustSize = Permissions.hasPermissionRange(player, Permission.PERMISSION_TRUST, Settings.Limit.MAX_PLOTS);
|
||||
if (size > maxTrustSize) {
|
||||
if (localTrustSize > maxTrustSize) {
|
||||
player.sendMessage(
|
||||
TranslatableCaption.of("members.plot_max_members_trusted"),
|
||||
Template.of("amount", String.valueOf(size - 1))
|
||||
Template.of("amount", String.valueOf(localTrustSize))
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user