From 167bb4e2665a6679ce288ecdc09f93285ebe066b Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Tue, 11 Nov 2025 17:05:46 +0100 Subject: [PATCH] Fix YMLWrapper --- BauSystem/build.gradle.kts | 1 + CommonCore/SQL/src/de/steamwar/sql/YMLWrapper.java | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/BauSystem/build.gradle.kts b/BauSystem/build.gradle.kts index aeade561..df33b12e 100644 --- a/BauSystem/build.gradle.kts +++ b/BauSystem/build.gradle.kts @@ -50,5 +50,6 @@ tasks.register("DevBau21") { description = "Run a 1.21 Dev Bau" dependsOn(":SpigotCore:shadowJar") dependsOn(":BauSystem:shadowJar") + dependsOn(":SchematicSystem:shadowJar") template = "Bau21" } diff --git a/CommonCore/SQL/src/de/steamwar/sql/YMLWrapper.java b/CommonCore/SQL/src/de/steamwar/sql/YMLWrapper.java index 98d23ad3..5a5f62aa 100644 --- a/CommonCore/SQL/src/de/steamwar/sql/YMLWrapper.java +++ b/CommonCore/SQL/src/de/steamwar/sql/YMLWrapper.java @@ -100,7 +100,15 @@ final class YMLWrapper { } 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) {