mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-12 19:30:48 +01:00
Add -e flag to /rg flag to set a flag to an empty value.
Closes WORLDGUARD-3161.
This commit is contained in:
parent
cdab004505
commit
f858c175f9
@ -455,7 +455,7 @@ public void list(CommandContext args, CommandSender sender) throws CommandExcept
|
||||
*/
|
||||
@Command(aliases = {"flag", "f"},
|
||||
usage = "<id> <flag> [-w world] [-g group] [value]",
|
||||
flags = "g:w:",
|
||||
flags = "g:w:e",
|
||||
desc = "Set flags",
|
||||
min = 2)
|
||||
public void flag(CommandContext args, CommandSender sender) throws CommandException {
|
||||
@ -467,6 +467,14 @@ public void flag(CommandContext args, CommandSender sender) throws CommandExcept
|
||||
RegionGroup groupValue = null;
|
||||
RegionPermissionModel permModel = getPermissionModel(sender);
|
||||
|
||||
if (args.hasFlag('e')) {
|
||||
if (value != null) {
|
||||
throw new CommandException("You cannot use -e(mpty) with a flag value.");
|
||||
}
|
||||
|
||||
value = "";
|
||||
}
|
||||
|
||||
// Add color codes
|
||||
if (value != null) {
|
||||
value = CommandUtils.replaceColorMacros(value);
|
||||
|
Loading…
Reference in New Issue
Block a user