From eb3f66c6da961d56718bbd75537a342b8b363887 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Fri, 23 Sep 2022 06:08:43 +0100 Subject: [PATCH] Updated Upstream (Bukkit/CraftBukkit) (#8378) --- patches/api/Adventure.patch | 2 +- patches/api/Build-system-changes.patch | 2 +- patches/api/Convert-project-to-Gradle.patch | 4 +- ...-limit-in-YamlConfigOptions-and-incr.patch | 61 +++++++++++++++++++ .../Remove-garbage-Java-version-check.patch | 4 +- work/Bukkit | 2 +- work/CraftBukkit | 2 +- 7 files changed, 69 insertions(+), 8 deletions(-) create mode 100644 patches/api/Expose-codepoint-limit-in-YamlConfigOptions-and-incr.patch diff --git a/patches/api/Adventure.patch b/patches/api/Adventure.patch index 9def27e122..b414916c63 100644 --- a/patches/api/Adventure.patch +++ b/patches/api/Adventure.patch @@ -33,7 +33,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 api("com.google.code.gson:gson:2.8.9") - api("net.md-5:bungeecord-chat:1.16-R0.4") + api("net.md-5:bungeecord-chat:1.16-R0.4-deprecated+build.6") // Paper - api("org.yaml:snakeyaml:1.30") + api("org.yaml:snakeyaml:1.32") // Paper start api("com.googlecode.json-simple:json-simple:1.1.1") { isTransitive = false // includes junit diff --git a/patches/api/Build-system-changes.patch b/patches/api/Build-system-changes.patch index 443358d0c3..456ac74e7c 100644 --- a/patches/api/Build-system-changes.patch +++ b/patches/api/Build-system-changes.patch @@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ dependencies { api("com.google.code.gson:gson:2.8.9") api("net.md-5:bungeecord-chat:1.16-R0.4") - api("org.yaml:snakeyaml:1.30") + api("org.yaml:snakeyaml:1.32") + // Paper start + api("com.googlecode.json-simple:json-simple:1.1.1") { + isTransitive = false // includes junit diff --git a/patches/api/Convert-project-to-Gradle.patch b/patches/api/Convert-project-to-Gradle.patch index f903c5dda2..1528448946 100644 --- a/patches/api/Convert-project-to-Gradle.patch +++ b/patches/api/Convert-project-to-Gradle.patch @@ -46,7 +46,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + api("com.google.guava:guava:31.0.1-jre") + api("com.google.code.gson:gson:2.8.9") + api("net.md-5:bungeecord-chat:1.16-R0.4") -+ api("org.yaml:snakeyaml:1.30") ++ api("org.yaml:snakeyaml:1.32") + + compileOnly("org.apache.maven:maven-resolver-provider:3.8.5") + compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3") @@ -175,7 +175,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - org.yaml - snakeyaml -- 1.30 +- 1.32 - compile - - diff --git a/patches/api/Expose-codepoint-limit-in-YamlConfigOptions-and-incr.patch b/patches/api/Expose-codepoint-limit-in-YamlConfigOptions-and-incr.patch new file mode 100644 index 0000000000..b37b835d4d --- /dev/null +++ b/patches/api/Expose-codepoint-limit-in-YamlConfigOptions-and-incr.patch @@ -0,0 +1,61 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shane Freeder +Date: Thu, 22 Sep 2022 07:04:30 +0100 +Subject: [PATCH] Expose codepoint limit in YamlConfigOptions, and increase + default + + +diff --git a/src/main/java/org/bukkit/configuration/file/YamlConfiguration.java b/src/main/java/org/bukkit/configuration/file/YamlConfiguration.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/configuration/file/YamlConfiguration.java ++++ b/src/main/java/org/bukkit/configuration/file/YamlConfiguration.java +@@ -0,0 +0,0 @@ public class YamlConfiguration extends FileConfiguration { + public void loadFromString(@NotNull String contents) throws InvalidConfigurationException { + Preconditions.checkArgument(contents != null, "Contents cannot be null"); + yamlLoaderOptions.setProcessComments(options().parseComments()); ++ yamlLoaderOptions.setCodePointLimit(options().codePointLimit()); // Paper + + MappingNode node; + try (Reader reader = new UnicodeReader(new ByteArrayInputStream(contents.getBytes(StandardCharsets.UTF_8)))) { +diff --git a/src/main/java/org/bukkit/configuration/file/YamlConfigurationOptions.java b/src/main/java/org/bukkit/configuration/file/YamlConfigurationOptions.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/configuration/file/YamlConfigurationOptions.java ++++ b/src/main/java/org/bukkit/configuration/file/YamlConfigurationOptions.java +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable; + public class YamlConfigurationOptions extends FileConfigurationOptions { + private int indent = 2; + private int width = 80; ++ private int codePointLimit = 64 * 1024 * 1024; // 64 MB // Paper + + protected YamlConfigurationOptions(@NotNull YamlConfiguration configuration) { + super(configuration); +@@ -0,0 +0,0 @@ public class YamlConfigurationOptions extends FileConfigurationOptions { + this.width = value; + return this; + } ++ ++ // Paper start ++ /** ++ * Gets the maximum code point limit, that being, the maximum length of the document ++ * in which the loader will read ++ * ++ * @return The current value ++ */ ++ public int codePointLimit() { ++ return codePointLimit; ++ } ++ ++ /** ++ * Sets the maximum code point limit, that being, the maximum length of the document ++ * in which the loader will read ++ * ++ * @param codePointLimit new codepoint limit ++ * @return This object, for chaining ++ */ ++ @NotNull ++ public YamlConfigurationOptions codePointLimit(int codePointLimit) { ++ this.codePointLimit = codePointLimit; ++ return this; ++ } ++ // Paper end + } diff --git a/patches/server/Remove-garbage-Java-version-check.patch b/patches/server/Remove-garbage-Java-version-check.patch index 94994e86fa..422da8db0d 100644 --- a/patches/server/Remove-garbage-Java-version-check.patch +++ b/patches/server/Remove-garbage-Java-version-check.patch @@ -12,8 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 System.err.println("Unsupported Java detected (" + javaVersion + "). This version of Minecraft requires at least Java 17. Check your Java version with the command 'java -version'."); return; } -- if (javaVersion > 62.0) { -- System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 18 is supported."); +- if (javaVersion > 63.0) { +- System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 19 is supported."); - return; - } diff --git a/work/Bukkit b/work/Bukkit index 9ae3f10f8f..acdb55f9a9 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 9ae3f10f8fa50a825af823131c468c36da3be880 +Subproject commit acdb55f9a97c6b361947405717eb710b0200e165 diff --git a/work/CraftBukkit b/work/CraftBukkit index dc57aa3580..08cdd26ca9 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit dc57aa358022f2c611f261a5e0cd6e8aef24bf78 +Subproject commit 08cdd26ca9c8fbae22ffa03f79ecc564f015e260