mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-01-31 14:49:35 +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
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user