diff --git a/PlotSquared/src/com/intellectualcrafters/plot/Flag.java b/PlotSquared/src/com/intellectualcrafters/plot/Flag.java index 0e038a13b..310f1f720 100644 --- a/PlotSquared/src/com/intellectualcrafters/plot/Flag.java +++ b/PlotSquared/src/com/intellectualcrafters/plot/Flag.java @@ -28,7 +28,10 @@ public class Flag { throw new IllegalArgumentException("Value must be <= 48 characters"); } this.key = key; - this.value = value; + this.value = key.parseValue(value); + if (this.value==null) { + throw new IllegalArgumentException(key.getValueDesc()); + } } /** diff --git a/PlotSquared/src/com/intellectualcrafters/plot/commands/Set.java b/PlotSquared/src/com/intellectualcrafters/plot/commands/Set.java index 6b788fca1..fa2f82e24 100644 --- a/PlotSquared/src/com/intellectualcrafters/plot/commands/Set.java +++ b/PlotSquared/src/com/intellectualcrafters/plot/commands/Set.java @@ -91,13 +91,13 @@ public class Set extends SubCommand { return false; } - AbstractFlag af = new AbstractFlag(""); + AbstractFlag af; try { - af = new AbstractFlag(args[1].toLowerCase()); + af = FlagManager.getFlag(args[1].toLowerCase()); } catch (Exception e) { - + af = new AbstractFlag(args[1].toLowerCase()); } if (!FlagManager.getFlags().contains(af) && ((PlotMain.worldGuardListener == null) || !PlotMain.worldGuardListener.str_flags.contains(args[1].toLowerCase()))) { @@ -141,7 +141,6 @@ public class Set extends SubCommand { try { String value = StringUtils.join(Arrays.copyOfRange(args, 2, args.length), " "); value = af.parseValue(value); - if (value==null) { PlayerFunctions.sendMessage(plr, af.getValueDesc()); return false;