forked from SteamWar/SteamWar
Fix YMLWrapper
This commit is contained in:
@@ -100,7 +100,15 @@ final class YMLWrapper<M, W> {
|
||||
}
|
||||
|
||||
public double getDouble(String path, double defaultValue) {
|
||||
return get(path, defaultValue, Double.class::cast);
|
||||
return get(path, defaultValue, o -> {
|
||||
if (o instanceof Integer) {
|
||||
return (Double) (double) (Integer) o;
|
||||
} else if (o instanceof Double) {
|
||||
return (Double) o;
|
||||
} else {
|
||||
throw new ClassCastException(o + " is not a double or integer");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public boolean getBoolean(String path, boolean defaultValue) {
|
||||
|
||||
Reference in New Issue
Block a user