From 2ffb2d08a66e65ba67bceb4b7ba29b8359cd8a80 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Fri, 24 Oct 2014 00:41:57 +1100 Subject: [PATCH] should be fixed now. --- PlotSquared/src/com/intellectualcrafters/plot/Flag.java | 5 ++++- .../src/com/intellectualcrafters/plot/commands/Set.java | 7 +++---- 2 files changed, 7 insertions(+), 5 deletions(-) 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;