mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-01-31 22:59:34 +01:00
Fix boolean flags defaulting to false.
This commit is contained in:
parent
bdcd327d9b
commit
bcc366fc3c
@ -48,10 +48,22 @@ public abstract class FlagValue<T> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean parse(final String t) {
|
public Boolean parse(final String t) {
|
||||||
try {
|
switch (t.toLowerCase()) {
|
||||||
return Boolean.parseBoolean(t);
|
case "1":
|
||||||
} catch (final IllegalArgumentException e) {
|
case "yes":
|
||||||
return null;
|
case "allow":
|
||||||
|
case "true": {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
case "0":
|
||||||
|
case "no":
|
||||||
|
case "deny":
|
||||||
|
case "false": {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user