mirror of
https://github.com/MilkBowl/Vault.git
synced 2024-11-23 19:16:31 +01:00
booleans aren't numbers
This commit is contained in:
parent
4b7f9cdc99
commit
730e881c75
@ -192,13 +192,11 @@ public class Chat_bPermissions extends Chat {
|
||||
@Override
|
||||
public boolean getPlayerInfoBoolean(String world, String player, String node, boolean defaultValue) {
|
||||
String s = getPlayerInfoString(world, player, node, null);
|
||||
if (s == null)
|
||||
return defaultValue;
|
||||
try {
|
||||
boolean b = Boolean.valueOf(s);
|
||||
return b;
|
||||
} catch (NumberFormatException e) {
|
||||
if (s == null) {
|
||||
return defaultValue;
|
||||
} else {
|
||||
Boolean val = Boolean.valueOf(s);
|
||||
return val != null ? val : defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
@ -212,11 +210,9 @@ public class Chat_bPermissions extends Chat {
|
||||
String s = getGroupInfoString(world, group, node, null);
|
||||
if (s == null)
|
||||
return defaultValue;
|
||||
try {
|
||||
boolean b = Boolean.valueOf(s);
|
||||
return b;
|
||||
} catch (NumberFormatException e) {
|
||||
return defaultValue;
|
||||
else {
|
||||
Boolean val = Boolean.valueOf(s);
|
||||
return val != null ? val : defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -194,11 +194,9 @@ public class Chat_bPermissions2 extends Chat {
|
||||
String s = getPlayerInfoString(world, player, node, null);
|
||||
if (s == null)
|
||||
return defaultValue;
|
||||
try {
|
||||
boolean b = Boolean.valueOf(s);
|
||||
return b;
|
||||
} catch (NumberFormatException e) {
|
||||
return defaultValue;
|
||||
else {
|
||||
Boolean val = Boolean.valueOf(s);
|
||||
return val != null ? val : defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
@ -210,13 +208,11 @@ public class Chat_bPermissions2 extends Chat {
|
||||
@Override
|
||||
public boolean getGroupInfoBoolean(String world, String group, String node, boolean defaultValue) {
|
||||
String s = getGroupInfoString(world, group, node, null);
|
||||
if (s == null)
|
||||
return defaultValue;
|
||||
try {
|
||||
boolean b = Boolean.valueOf(s);
|
||||
return b;
|
||||
} catch (NumberFormatException e) {
|
||||
if (s == null) {
|
||||
return defaultValue;
|
||||
} else {
|
||||
Boolean val = Boolean.valueOf(s);
|
||||
return val != null ? val : defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -198,8 +198,10 @@ public class Chat_iChat extends Chat {
|
||||
String val = getPlayerInfoString(world, player, node, null);
|
||||
if (val == null)
|
||||
return defaultValue;
|
||||
|
||||
return Boolean.valueOf(val);
|
||||
else {
|
||||
Boolean v = Boolean.valueOf(val);
|
||||
return v != null ? v : defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -183,13 +183,11 @@ public class Chat_mChat extends Chat {
|
||||
@Override
|
||||
public boolean getPlayerInfoBoolean(String world, String player, String node, boolean defaultValue) {
|
||||
String s = getPlayerInfoString(world, player, node, null);
|
||||
if (s == null)
|
||||
return defaultValue;
|
||||
|
||||
try {
|
||||
return Boolean.valueOf(s);
|
||||
} catch (NumberFormatException e) {
|
||||
if (s == null) {
|
||||
return defaultValue;
|
||||
} else {
|
||||
Boolean val = Boolean.valueOf(s);
|
||||
return val != null ? val : defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user