From bcc366fc3cfa5605eb1fd9687fec5f1c0912d765 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Sun, 29 Mar 2015 17:12:32 +1100 Subject: [PATCH] Fix boolean flags defaulting to false. --- .../plot/flag/FlagValue.java | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/flag/FlagValue.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/flag/FlagValue.java index 7a13427f0..92ac85edf 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/flag/FlagValue.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/flag/FlagValue.java @@ -48,10 +48,22 @@ public abstract class FlagValue { @Override public Boolean parse(final String t) { - try { - return Boolean.parseBoolean(t); - } catch (final IllegalArgumentException e) { - return null; + switch (t.toLowerCase()) { + case "1": + case "yes": + case "allow": + case "true": { + return true; + } + case "0": + case "no": + case "deny": + case "false": { + return false; + } + default: { + return null; + } } }