Update upstream (for 1.19.3 support) #4

Zusammengeführt
Lixfel hat 74 Commits von upstream nach main 2023-02-02 11:32:53 +01:00 zusammengeführt
2 geänderte Dateien mit 15 neuen und 5 gelöschten Zeilen
Nur Änderungen aus Commit 87f680683d werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -12,7 +12,7 @@ applyPlatformAndCoreConfiguration()
dependencies {
constraints {
implementation("org.yaml:snakeyaml") {
version { strictly("1.30") }
version { strictly("1.33") }
because("Bukkit provides SnakeYaml")
}
}

Datei anzeigen

@ -21,6 +21,7 @@ package com.sk89q.util.yaml;
import com.sk89q.util.StringUtil;
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.LoaderOptions;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.SafeConstructor;
import org.yaml.snakeyaml.nodes.Tag;
@ -89,13 +90,22 @@ public class YAMLProcessor extends YAMLNode {
super(new LinkedHashMap<>(), writeDefaults);
this.format = format;
DumperOptions options = new DumperOptions();
options.setIndent(4);
options.setDefaultFlowStyle(format.getStyle());
DumperOptions dumperOptions = new DumperOptions();
dumperOptions.setIndent(4);
dumperOptions.setDefaultFlowStyle(format.getStyle());
Representer representer = new FancyRepresenter();
representer.setDefaultFlowStyle(format.getStyle());
yaml = new Yaml(new SafeConstructor(), representer, options);
LoaderOptions loaderOptions = new LoaderOptions();
try {
// 64 MB default
int yamlCodePointLimit = Integer.getInteger("worldedit.yaml.codePointLimit", 64 * 1024 * 1024);
loaderOptions.setCodePointLimit(yamlCodePointLimit);
} catch (NoSuchMethodError ignored) {
// pre-1.32 snakeyaml
}
yaml = new Yaml(new SafeConstructor(), representer, dumperOptions, loaderOptions);
this.file = file;
}