Bump snakeyaml to match spigot, use default ctors.

This commit is contained in:
wizjany 2023-06-08 10:37:46 -04:00 committed by Maddy Miller
parent 066a7abf7f
commit 91c9786e27
2 changed files with 4 additions and 3 deletions

View File

@ -29,7 +29,7 @@
dependencies {
constraints {
"implementation"( "org.yaml:snakeyaml") {
version { require("1.33") }
version { require("2.0") }
because("Bukkit provides SnakeYaml")
}
}
@ -37,7 +37,7 @@
"api"(project(":worldedit-libs:core"))
"compileOnly"("de.schlichtherle:truezip:6.8.4")
"implementation"("org.mozilla:rhino-runtime:1.7.13")
"implementation"("org.yaml:snakeyaml:1.33")
"implementation"("org.yaml:snakeyaml:2.0")
"implementation"("com.google.guava:guava")
"compileOnlyApi"("com.google.code.findbugs:jsr305:1.3.9")
"implementation"("com.google.code.gson:gson")

View File

@ -104,7 +104,7 @@ public YAMLProcessor(File file, boolean writeDefaults, YAMLFormat format) {
// pre-1.32 snakeyaml
}
yaml = new Yaml(new SafeConstructor(), representer, dumperOptions, loaderOptions);
yaml = new Yaml(new SafeConstructor(new LoaderOptions()), representer, dumperOptions, loaderOptions);
this.file = file;
}
@ -308,6 +308,7 @@ public static YAMLNode getEmptyNode(boolean writeDefaults) {
private static class FancyRepresenter extends Representer {
private FancyRepresenter() {
super(new DumperOptions());
this.nullRepresenter = o -> representScalar(Tag.NULL, "");
}
}