mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2025-02-12 03:59:22 +00:00
Fix boolean flags defaulting to false.
This commit is contained in:
parent
bdcd327d9b
commit
bcc366fc3c
1 changed files with 16 additions and 4 deletions
|
@ -48,12 +48,24 @@ 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":
|
||||||
|
case "allow":
|
||||||
|
case "true": {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
case "0":
|
||||||
|
case "no":
|
||||||
|
case "deny":
|
||||||
|
case "false": {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
|
|
Loading…
Reference in a new issue