From 6c7daa3dd93f5c023c5b7bfad1da246eee775e45 Mon Sep 17 00:00:00 2001 From: Joo200 Date: Thu, 8 Jun 2023 20:55:11 +0200 Subject: [PATCH] deps: Update Paper to 1.20, snakeyml to 2.0 --- worldguard-bukkit/build.gradle.kts | 4 ++-- worldguard-core/build.gradle.kts | 2 +- .../protection/managers/storage/sql/SQLRegionDatabase.java | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/worldguard-bukkit/build.gradle.kts b/worldguard-bukkit/build.gradle.kts index e7d66697..5a03aa8a 100644 --- a/worldguard-bukkit/build.gradle.kts +++ b/worldguard-bukkit/build.gradle.kts @@ -20,8 +20,8 @@ dependencies { "api"(project(":worldguard-core")) - "compileOnly"("io.papermc.paper:paper-api:1.19.3-R0.1-SNAPSHOT") - "runtimeOnly"("org.spigotmc:spigot-api:1.19.3-R0.1-SNAPSHOT") { + "compileOnly"("io.papermc.paper:paper-api:1.20-R0.1-SNAPSHOT") + "runtimeOnly"("org.spigotmc:spigot-api:1.20-R0.1-SNAPSHOT") { exclude("junit", "junit") } "api"("com.sk89q.worldedit:worldedit-bukkit:${Versions.WORLDEDIT}") { isTransitive = false } diff --git a/worldguard-core/build.gradle.kts b/worldguard-core/build.gradle.kts index a7283a2c..9e566616 100644 --- a/worldguard-core/build.gradle.kts +++ b/worldguard-core/build.gradle.kts @@ -8,7 +8,7 @@ "api"(project(":worldguard-libs:core")) "api"("com.sk89q.worldedit:worldedit-core:${Versions.WORLDEDIT}") "implementation"("org.flywaydb:flyway-core:3.0") - "implementation"("org.yaml:snakeyaml:1.33") + "implementation"("org.yaml:snakeyaml:2.0") "implementation"("com.google.guava:guava:${Versions.GUAVA}") "compileOnly"("com.google.code.findbugs:jsr305:${Versions.FINDBUGS}") diff --git a/worldguard-core/src/main/java/com/sk89q/worldguard/protection/managers/storage/sql/SQLRegionDatabase.java b/worldguard-core/src/main/java/com/sk89q/worldguard/protection/managers/storage/sql/SQLRegionDatabase.java index b6b99b0d..5ea5e585 100644 --- a/worldguard-core/src/main/java/com/sk89q/worldguard/protection/managers/storage/sql/SQLRegionDatabase.java +++ b/worldguard-core/src/main/java/com/sk89q/worldguard/protection/managers/storage/sql/SQLRegionDatabase.java @@ -32,6 +32,7 @@ import com.sk89q.worldguard.util.sql.DataSourceConfig; import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.DumperOptions.FlowStyle; +import org.yaml.snakeyaml.LoaderOptions; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.SafeConstructor; import org.yaml.snakeyaml.representer.Representer; @@ -191,11 +192,11 @@ static Yaml createYaml() { DumperOptions options = new DumperOptions(); options.setIndent(2); options.setDefaultFlowStyle(FlowStyle.FLOW); - Representer representer = new Representer(); + Representer representer = new Representer(options); representer.setDefaultFlowStyle(FlowStyle.FLOW); // We have to use this in order to properly save non-string values - return new Yaml(new SafeConstructor(), new Representer(), options); + return new Yaml(new SafeConstructor(new LoaderOptions()), representer, options); } @Override