mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-28 11:44:42 +02:00
Fix
Fixes #724 Fixes flag remove for non list based flags when player lacks permission.
This commit is contained in:
@ -158,6 +158,10 @@ public class FlagCmd extends SubCommand {
|
||||
}
|
||||
final Flag flag = FlagManager.getPlotFlagAbs(plot, args[1].toLowerCase());
|
||||
if (!Permissions.hasPermission(player, "plots.set.flag." + args[1].toLowerCase())) {
|
||||
if (args.length != 2) {
|
||||
MainUtil.sendMessage(player, C.NO_PERMISSION, "plots.set.flag." + args[1].toLowerCase());
|
||||
return false;
|
||||
}
|
||||
for (final String entry : args[2].split(",")) {
|
||||
if (!Permissions.hasPermission(player, "plots.set.flag." + args[1].toLowerCase() + "." + entry)) {
|
||||
MainUtil.sendMessage(player, C.NO_PERMISSION, "plots.set.flag." + args[1].toLowerCase() + "." + entry);
|
||||
|
@ -59,6 +59,12 @@ public class Set extends SubCommand {
|
||||
|
||||
public Set() {
|
||||
component = new SetCommand() {
|
||||
|
||||
@Override
|
||||
public String getCommand() {
|
||||
return "set.component";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean set(PlotPlayer plr, final Plot plot, String value) {
|
||||
final String world = plr.getLocation().getWorld();
|
||||
@ -171,7 +177,7 @@ public class Set extends SubCommand {
|
||||
// components
|
||||
HashSet<String> components = new HashSet<String>(Arrays.asList(plot.getManager().getPlotComponents(plot.getWorld(), plot.id)));
|
||||
if (components.contains(args[0].toLowerCase())) {
|
||||
return component.set(plr, plot, StringMan.join(args, " "));
|
||||
return component.onCommand(plr, Arrays.copyOfRange(args, 1, args.length));
|
||||
}
|
||||
// flag
|
||||
{
|
||||
|
Reference in New Issue
Block a user