mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-27 18:41:35 +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"},
|
@Command(aliases = {"flag", "f"},
|
||||||
usage = "<id> <flag> [-w world] [-g group] [value]",
|
usage = "<id> <flag> [-w world] [-g group] [value]",
|
||||||
flags = "g:w:",
|
flags = "g:w:e",
|
||||||
desc = "Set flags",
|
desc = "Set flags",
|
||||||
min = 2)
|
min = 2)
|
||||||
public void flag(CommandContext args, CommandSender sender) throws CommandException {
|
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;
|
RegionGroup groupValue = null;
|
||||||
RegionPermissionModel permModel = getPermissionModel(sender);
|
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
|
// Add color codes
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
value = CommandUtils.replaceColorMacros(value);
|
value = CommandUtils.replaceColorMacros(value);
|
||||||
|
Loading…
Reference in New Issue
Block a user