Fix YMLWrapper

This commit is contained in:
2025-11-11 17:05:46 +01:00
parent f6a9ce184b
commit 167bb4e266
2 changed files with 10 additions and 1 deletions
+1
View File
@@ -50,5 +50,6 @@ tasks.register<DevServer>("DevBau21") {
description = "Run a 1.21 Dev Bau"
dependsOn(":SpigotCore:shadowJar")
dependsOn(":BauSystem:shadowJar")
dependsOn(":SchematicSystem:shadowJar")
template = "Bau21"
}
@@ -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) {