From e21ab955f5759cd3eb804e5474d11da858a0795e Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Wed, 8 May 2024 20:22:05 +0100 Subject: [PATCH 1/2] Update terminal dependencies Need to also look into log4j, but, so far 1) Updated to jline-terminal 3.26.1 - jline, however, has deprecated their jansi provider, and so, we're going back to JNA. FFM looks interesting, but, might not work on java 21, and, seems to requore some additional java flags to open stuff up to allow it to work, however, seemed to work without on macOS? 2) added a hackaround to try to migate the terminal issues we're facing on windows, will probably look towards adding a detection step for PS7 so we can disable the hack, but, in the meantime, this at least works around the issue. --- ...oleAppender-for-console-improvements.patch | 42 +++++++++++++++++-- ...n-prefixes-using-Log4J-configuration.patch | 4 +- ...r-to-keep-logging-IO-off-main-thread.patch | 4 +- ...ktraces-in-log-messages-crash-report.patch | 4 +- patches/server/0020-Plugin-remapping.patch | 6 +-- ...ion-calls-in-plugins-using-internals.patch | 6 +-- .../server/0140-Basic-PlayerProfile-API.patch | 4 +- .../server/0282-Brigadier-Mojang-API.patch | 6 +-- .../server/0362-Implement-Mob-Goal-API.patch | 4 +- ...4-Bukkit-world-container-is-not-used.patch | 4 +- ...-5885-Unable-to-disable-advancements.patch | 4 +- ...nment-variable-to-disable-server-gui.patch | 4 +- .../0722-Add-support-for-Proxy-Protocol.patch | 4 +- .../server/0776-Detect-headless-JREs.patch | 4 +- ...Fix-demo-flag-not-enabling-demo-mode.patch | 4 +- .../server/0981-Rewrite-chunk-system.patch | 10 ++--- ...ocity-compression-and-cipher-natives.patch | 4 +- ...x-and-optimise-world-force-upgrading.patch | 6 +-- 18 files changed, 79 insertions(+), 45 deletions(-) diff --git a/patches/server/0011-Use-TerminalConsoleAppender-for-console-improvements.patch b/patches/server/0011-Use-TerminalConsoleAppender-for-console-improvements.patch index d9da8ba8fdd7..879ce8d2466b 100644 --- a/patches/server/0011-Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/patches/server/0011-Use-TerminalConsoleAppender-for-console-improvements.patch @@ -25,10 +25,10 @@ Other changes: Co-Authored-By: Emilia Kond diff --git a/build.gradle.kts b/build.gradle.kts -index 18221614060ec945cb8b197acd276e45450f7394..90ca693814a82c30de238b0228750b769a9a9c80 100644 +index 18221614060ec945cb8b197acd276e45450f7394..129d29deb929b3a26913a5a1bf9e9d6633884189 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -5,9 +5,29 @@ plugins { +@@ -5,9 +5,30 @@ plugins { `maven-publish` } @@ -42,7 +42,8 @@ index 18221614060ec945cb8b197acd276e45450f7394..90ca693814a82c30de238b0228750b76 implementation(project(":paper-api")) - implementation("jline:jline:2.12.1") + // Paper start -+ implementation("org.jline:jline-terminal-jansi:3.21.0") ++ //implementation("org.jline:jline-terminal-ffm:3.26.1") TODO: Investigate if this is broken with java 21 ++ implementation("org.jline:jline-terminal-jni:3.26.1") + implementation("net.minecrell:terminalconsoleappender:1.3.0") + implementation("net.kyori:adventure-text-serializer-ansi:4.17.0") // Keep in sync with adventureVersion from Paper-API build file + /* @@ -59,7 +60,7 @@ index 18221614060ec945cb8b197acd276e45450f7394..90ca693814a82c30de238b0228750b76 implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") // Paper - remove exclusion implementation("org.ow2.asm:asm-commons:9.7") implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files -@@ -78,6 +98,19 @@ tasks.check { +@@ -78,6 +99,19 @@ tasks.check { dependsOn(scanJar) } // Paper end @@ -259,6 +260,39 @@ index 8323f135d6bf2e1f12525e05094ffa3f2420e7e1..a143ea1e58464a3122fbd8ccafe417bd + return PaperAdventure.ANSI_SERIALIZER.serialize(GlobalTranslator.render(message, Locale.getDefault())); } } +diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java +index 5b4ac7b4fd0077e900e9f788963f1613bbc9a5d0..544354eec56b884e322185dc0c6d43f3fa090f15 100644 +--- a/src/main/java/net/minecraft/server/Main.java ++++ b/src/main/java/net/minecraft/server/Main.java +@@ -152,6 +152,28 @@ public class Main { + return; + } + ++ // Paper start - Use TCA for console - hack for broken Windows Java versions ++ if (System.getProperty("os.name").startsWith("Windows 1")) { ++ boolean isBrokenJavaWindowsVersion = false; ++ try { ++ final Integer javaSpec = Integer.getInteger("java.specification.version"); ++ if (javaSpec >= 22) { ++ isBrokenJavaWindowsVersion = true; ++ } ++ } catch (NumberFormatException ex) { ++ Main.LOGGER.info("Unable to determine Java version, assuming broken Windows Java version"); ++ isBrokenJavaWindowsVersion = true; ++ } ++ if (isBrokenJavaWindowsVersion) { ++ // TODO: Detect PS version ++ Main.LOGGER.warn("You are using a version of java with a known terminal issue, We will attempt to mitigate this"); ++ Main.LOGGER.warn("However, you should update to powershell 7 to mitigate this"); ++ System.setProperty("jdk.console", "java.base"); ++ } ++ ++ } ++ // Paper end - Use TCA for console - hack for broken Windows Java versions ++ + // Spigot Start + boolean eulaAgreed = Boolean.getBoolean( "com.mojang.eula.agree" ); + if ( eulaAgreed ) diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java index 953e28f0cf60412a4ec9e311daa98f9d3cadea85..c25d80a1d5aa0f3cc2cbf1e9b94154c759aab36e 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/patches/server/0012-Handle-plugin-prefixes-using-Log4J-configuration.patch b/patches/server/0012-Handle-plugin-prefixes-using-Log4J-configuration.patch index 4071c815657a..7b2e11f097b0 100644 --- a/patches/server/0012-Handle-plugin-prefixes-using-Log4J-configuration.patch +++ b/patches/server/0012-Handle-plugin-prefixes-using-Log4J-configuration.patch @@ -15,10 +15,10 @@ This may cause additional prefixes to be disabled for plugins bypassing the plugin logger. diff --git a/build.gradle.kts b/build.gradle.kts -index f7a1c358b0caf524707dcf1346d1d5a22500ce59..1d9baec8ebafb694e259af6a24892a899791a550 100644 +index 129d29deb929b3a26913a5a1bf9e9d6633884189..feaa89c8b653daadc1fc1d6054ba2b040e58f650 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -23,7 +23,7 @@ dependencies { +@@ -24,7 +24,7 @@ dependencies { all its classes to check if they are plugins. Scanning takes about 1-2 seconds so adding this speeds up the server start. */ diff --git a/patches/server/0014-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch b/patches/server/0014-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch index b149928c11b6..9c6a76a016ec 100644 --- a/patches/server/0014-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch +++ b/patches/server/0014-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Use AsyncAppender to keep logging IO off main thread diff --git a/build.gradle.kts b/build.gradle.kts -index 1d9baec8ebafb694e259af6a24892a899791a550..cce667165ade3e42792516a4721c74b35e7caa2c 100644 +index feaa89c8b653daadc1fc1d6054ba2b040e58f650..90f00db54a51d7fd767b0825945cf6c207eb39bb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -34,6 +34,7 @@ dependencies { +@@ -35,6 +35,7 @@ dependencies { implementation("commons-lang:commons-lang:2.6") runtimeOnly("org.xerial:sqlite-jdbc:3.45.3.0") runtimeOnly("com.mysql:mysql-connector-j:8.3.0") diff --git a/patches/server/0015-Deobfuscate-stacktraces-in-log-messages-crash-report.patch b/patches/server/0015-Deobfuscate-stacktraces-in-log-messages-crash-report.patch index c1defa02b557..a4204dc05cc6 100644 --- a/patches/server/0015-Deobfuscate-stacktraces-in-log-messages-crash-report.patch +++ b/patches/server/0015-Deobfuscate-stacktraces-in-log-messages-crash-report.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Deobfuscate stacktraces in log messages, crash reports, and diff --git a/build.gradle.kts b/build.gradle.kts -index cce667165ade3e42792516a4721c74b35e7caa2c..65fb16941fa7e3a9b300696fb6bd2b562bca48cd 100644 +index 90f00db54a51d7fd767b0825945cf6c207eb39bb..b26d6e2b573ae806358656fbb7f2c89efeb8e008 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -45,6 +45,7 @@ dependencies { +@@ -46,6 +46,7 @@ dependencies { testImplementation("org.mockito:mockito-core:5.11.0") testImplementation("org.ow2.asm:asm-tree:9.7") testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest diff --git a/patches/server/0020-Plugin-remapping.patch b/patches/server/0020-Plugin-remapping.patch index 251d549a9bd3..9313eeabd3f1 100644 --- a/patches/server/0020-Plugin-remapping.patch +++ b/patches/server/0020-Plugin-remapping.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Plugin remapping Co-authored-by: Nassim Jahnke diff --git a/build.gradle.kts b/build.gradle.kts -index 65fb16941fa7e3a9b300696fb6bd2b562bca48cd..5ffd1d7c130e01a4a7516b361e48bfaf41d4f321 100644 +index b26d6e2b573ae806358656fbb7f2c89efeb8e008..3656f37763fb30fdf8643918d7d5652fc7fbd40c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -46,6 +46,7 @@ dependencies { +@@ -47,6 +47,7 @@ dependencies { testImplementation("org.ow2.asm:asm-tree:9.7") testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest implementation("net.neoforged:srgutils:1.0.9") // Paper - mappings handling @@ -17,7 +17,7 @@ index 65fb16941fa7e3a9b300696fb6bd2b562bca48cd..5ffd1d7c130e01a4a7516b361e48bfaf } paperweight { -@@ -164,20 +165,41 @@ val runtimeClasspathWithoutVanillaServer = configurations.runtimeClasspath.flatM +@@ -165,20 +166,41 @@ val runtimeClasspathWithoutVanillaServer = configurations.runtimeClasspath.flatM runtime.filterNot { it.asFile.absolutePath == vanilla } } diff --git a/patches/server/0022-Remap-reflection-calls-in-plugins-using-internals.patch b/patches/server/0022-Remap-reflection-calls-in-plugins-using-internals.patch index 522e4a2446df..75561aca9cb8 100644 --- a/patches/server/0022-Remap-reflection-calls-in-plugins-using-internals.patch +++ b/patches/server/0022-Remap-reflection-calls-in-plugins-using-internals.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Remap reflection calls in plugins using internals Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com> diff --git a/build.gradle.kts b/build.gradle.kts -index 5ffd1d7c130e01a4a7516b361e48bfaf41d4f321..e9498f78cb6c0973a820f093ff7a31bef44ba27f 100644 +index 3656f37763fb30fdf8643918d7d5652fc7fbd40c..847be62ae460af7567dfd515f2490ea39d3e9b9c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -47,6 +47,12 @@ dependencies { +@@ -48,6 +48,12 @@ dependencies { testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest implementation("net.neoforged:srgutils:1.0.9") // Paper - mappings handling implementation("net.neoforged:AutoRenamingTool:2.0.3") // Paper - remap plugins @@ -645,7 +645,7 @@ index 242811578a786e3807a1a7019d472d5a68f87116..0b65fdf53124f3dd042b2363b1b8df8e return traceElements; } diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index 8420a53672cfb0f060d9c85c445d200b6701f521..fc04bfcb8b5dfa6d093c8d75b2f20c502ef94a63 100644 +index 3d3d77d66588aaf709a9f7688400ee661e181b4b..c6956b9241634e455a520f4fd3bd8c4b5a58eb9d 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java @@ -76,36 +76,26 @@ public class Commodore { diff --git a/patches/server/0140-Basic-PlayerProfile-API.patch b/patches/server/0140-Basic-PlayerProfile-API.patch index 54a4ffa62b75..892aa371f28a 100644 --- a/patches/server/0140-Basic-PlayerProfile-API.patch +++ b/patches/server/0140-Basic-PlayerProfile-API.patch @@ -584,10 +584,10 @@ index 9e21566fc4d76ae2e305f0e1d47d8c2f1c1f2c4c..c95a0af32178fe24448a5ae7a229c86e * Calculates distance between 2 entities * @param e1 diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 6afede80c10503a261d0f735c351d943597be9ff..993296f9c2457809bd6b844c309895f417eb42a5 100644 +index d172331589bba908366eccff1ba88ba9b7fc85f1..e1dce422a222bcf3a98ba7abdc2eeb2931d005a3 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -168,7 +168,7 @@ public class Main { +@@ -190,7 +190,7 @@ public class Main { } File file = (File) optionset.valueOf("universe"); // CraftBukkit diff --git a/patches/server/0282-Brigadier-Mojang-API.patch b/patches/server/0282-Brigadier-Mojang-API.patch index a406a36b2051..375f09fd4082 100644 --- a/patches/server/0282-Brigadier-Mojang-API.patch +++ b/patches/server/0282-Brigadier-Mojang-API.patch @@ -10,7 +10,7 @@ Adds CommandRegisteredEvent - Allows manipulating the CommandNode to add more children/metadata for the client diff --git a/build.gradle.kts b/build.gradle.kts -index e9498f78cb6c0973a820f093ff7a31bef44ba27f..db2d67c98c62aa90591fea82e8fb07270699d96c 100644 +index 847be62ae460af7567dfd515f2490ea39d3e9b9c..1d62a51a0f77a94c50854c27178ac9397f905fc0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -13,6 +13,7 @@ val alsoShade: Configuration by configurations.creating @@ -19,8 +19,8 @@ index e9498f78cb6c0973a820f093ff7a31bef44ba27f..db2d67c98c62aa90591fea82e8fb0727 implementation(project(":paper-api")) + implementation(project(":paper-mojangapi")) // Paper start - implementation("org.jline:jline-terminal-jansi:3.21.0") - implementation("net.minecrell:terminalconsoleappender:1.3.0") + //implementation("org.jline:jline-terminal-ffm:3.26.1") TODO: Investigate if this is broken with java 21 + implementation("org.jline:jline-terminal-jni:3.26.1") diff --git a/src/main/java/com/mojang/brigadier/exceptions/CommandSyntaxException.java b/src/main/java/com/mojang/brigadier/exceptions/CommandSyntaxException.java index 3370731ee064d2693b972a0765c13dd4fd69f66a..09d486a05179b9d878e1c33725b4e614c3544da9 100644 --- a/src/main/java/com/mojang/brigadier/exceptions/CommandSyntaxException.java diff --git a/patches/server/0362-Implement-Mob-Goal-API.patch b/patches/server/0362-Implement-Mob-Goal-API.patch index 56f3af0c7361..500eed427698 100644 --- a/patches/server/0362-Implement-Mob-Goal-API.patch +++ b/patches/server/0362-Implement-Mob-Goal-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement Mob Goal API diff --git a/build.gradle.kts b/build.gradle.kts -index db2d67c98c62aa90591fea82e8fb07270699d96c..7a70c2c52dec44d6b6c7acc7140b2619e56646d0 100644 +index 1d62a51a0f77a94c50854c27178ac9397f905fc0..a4205a68214de8e6eb66098f4c9d766342c47796 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -41,6 +41,7 @@ dependencies { +@@ -42,6 +42,7 @@ dependencies { runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18") runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18") diff --git a/patches/server/0398-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch b/patches/server/0398-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch index fe347fabc4a8..d4cf9d1f3ebc 100644 --- a/patches/server/0398-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch +++ b/patches/server/0398-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix SPIGOT-5824 Bukkit world-container is not used diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 993296f9c2457809bd6b844c309895f417eb42a5..7dfcb8c6583d1c13fe688b5e17edb9d1c6935547 100644 +index e1dce422a222bcf3a98ba7abdc2eeb2931d005a3..b1aef620d4a302d80dbd102e09bccb139b2c536f 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -167,8 +167,17 @@ public class Main { +@@ -189,8 +189,17 @@ public class Main { return; } diff --git a/patches/server/0399-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch b/patches/server/0399-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch index df26348fac4c..4afc39220950 100644 --- a/patches/server/0399-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch +++ b/patches/server/0399-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix SPIGOT-5885 Unable to disable advancements diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 7dfcb8c6583d1c13fe688b5e17edb9d1c6935547..ded1b7ab4ca1ae3a2d799fe31d05bd6a0c27dcb7 100644 +index b1aef620d4a302d80dbd102e09bccb139b2c536f..5eb4088ac297899f55d593060745456fe8af2bf0 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -167,6 +167,7 @@ public class Main { +@@ -189,6 +189,7 @@ public class Main { return; } diff --git a/patches/server/0545-Add-environment-variable-to-disable-server-gui.patch b/patches/server/0545-Add-environment-variable-to-disable-server-gui.patch index e4de8ec4779d..f0181a372b0b 100644 --- a/patches/server/0545-Add-environment-variable-to-disable-server-gui.patch +++ b/patches/server/0545-Add-environment-variable-to-disable-server-gui.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add environment variable to disable server gui diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index ded1b7ab4ca1ae3a2d799fe31d05bd6a0c27dcb7..467b8ca8007c5d3a7b72b88e3a979bdf09f1a283 100644 +index 5eb4088ac297899f55d593060745456fe8af2bf0..75a3eac58677901daf3bb2df3a91279c5a8f5b63 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -318,6 +318,7 @@ public class Main { +@@ -340,6 +340,7 @@ public class Main { */ boolean flag2 = !optionset.has("nogui") && !optionset.nonOptionArguments().contains("nogui"); diff --git a/patches/server/0722-Add-support-for-Proxy-Protocol.patch b/patches/server/0722-Add-support-for-Proxy-Protocol.patch index 1ffaba091165..0ec44dca5ef7 100644 --- a/patches/server/0722-Add-support-for-Proxy-Protocol.patch +++ b/patches/server/0722-Add-support-for-Proxy-Protocol.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add support for Proxy Protocol diff --git a/build.gradle.kts b/build.gradle.kts -index 7a70c2c52dec44d6b6c7acc7140b2619e56646d0..9b9e744d18cf66279f51f950b6ecce31415f9fa8 100644 +index a4205a68214de8e6eb66098f4c9d766342c47796..d8621fa86ca8677d707afdabebd289bbf2132ec5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -28,6 +28,7 @@ dependencies { +@@ -29,6 +29,7 @@ dependencies { log4jPlugins.annotationProcessorConfigurationName("org.apache.logging.log4j:log4j-core:2.19.0") // Paper - Needed to generate meta for our Log4j plugins runtimeOnly(log4jPlugins.output) alsoShade(log4jPlugins.output) diff --git a/patches/server/0776-Detect-headless-JREs.patch b/patches/server/0776-Detect-headless-JREs.patch index 5ba28913a820..a065cbc043dd 100644 --- a/patches/server/0776-Detect-headless-JREs.patch +++ b/patches/server/0776-Detect-headless-JREs.patch @@ -27,10 +27,10 @@ index 68098dfe716e93aafcca4d8d5b5a81d8648b3654..2b7070e0cefa7cf0777df159693750fe + } } diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 467b8ca8007c5d3a7b72b88e3a979bdf09f1a283..13e1a914d4523f1c192db2a9a1ee6522e0ee27da 100644 +index 75a3eac58677901daf3bb2df3a91279c5a8f5b63..478b05198815e5c16f322f73331d68382e3f3e48 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -167,6 +167,18 @@ public class Main { +@@ -189,6 +189,18 @@ public class Main { return; } diff --git a/patches/server/0837-Fix-demo-flag-not-enabling-demo-mode.patch b/patches/server/0837-Fix-demo-flag-not-enabling-demo-mode.patch index d64dd23e3758..ac74e137af87 100644 --- a/patches/server/0837-Fix-demo-flag-not-enabling-demo-mode.patch +++ b/patches/server/0837-Fix-demo-flag-not-enabling-demo-mode.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix demo flag not enabling demo mode https://github.com/PaperMC/Paper/issues/9046 diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 13e1a914d4523f1c192db2a9a1ee6522e0ee27da..c33f85b570f159ab465b5a10a8044a81f2797f43 100644 +index 478b05198815e5c16f322f73331d68382e3f3e48..86c357c2d1ef9208e9a4716d5b83f06ab468e424 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -325,7 +325,9 @@ public class Main { +@@ -347,7 +347,9 @@ public class Main { /* dedicatedserver1.setPort((Integer) optionset.valueOf(optionspec11)); diff --git a/patches/server/0981-Rewrite-chunk-system.patch b/patches/server/0981-Rewrite-chunk-system.patch index b655a09a35b9..5a8f8cee2b97 100644 --- a/patches/server/0981-Rewrite-chunk-system.patch +++ b/patches/server/0981-Rewrite-chunk-system.patch @@ -14605,7 +14605,7 @@ index 0000000000000000000000000000000000000000..962d3cae6340fc11607b59355e291629 + +} diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java -index 5f59e733c00de9c0f5692b3b3c092a050a9f409f..b8a89bf8a7a0ef25f00ccc0e84ca64f4524fdc3e 100644 +index 4de88f74182bb596c6b5ad0351cc0dacefd0ce96..2874bc3001c4e7d9191e47ba512c5a68369c21f1 100644 --- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java +++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java @@ -29,6 +29,45 @@ public class GlobalConfiguration extends ConfigurationPart { @@ -15672,10 +15672,10 @@ index 0000000000000000000000000000000000000000..c78cbec447032de9fe69748591bef6be + } +} diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index c33f85b570f159ab465b5a10a8044a81f2797f43..244a19ecd0234fa1d7a6ecfea20751595688605d 100644 +index 86c357c2d1ef9208e9a4716d5b83f06ab468e424..81b00b4329f17f53c8543d08ef07fb6033b8b8e3 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -320,6 +320,7 @@ public class Main { +@@ -342,6 +342,7 @@ public class Main { convertable_conversionsession.saveDataTag(iregistrycustom_dimension, savedata); */ @@ -21612,7 +21612,7 @@ index 7dae8d91b74cc7df0745f0c121e3bea09b8d0b6d..1e2530c9e5212b6d2bdbc94817beddb4 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 271b376d51479a2adc42b41bb252e60234ddee5e..277a92c32e9f22974442b833700bc0f70bdb976a 100644 +index 8d148c72d9c3d04112451760919515fae83cffc8..859af2ce336f134dac0d97f916530e8e4e91a4e7 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1406,7 +1406,6 @@ public final class CraftServer implements Server { @@ -21744,7 +21744,7 @@ index 4b6a04e47f5d4c071607516519098fab317dcf12..01fc74e6cc8ea8808b821583afb26309 // Paper start - implement pointers diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index e1af41a8d938420694a5342f08b811615dc46003..33c553d1558b3cdfac22948f3878e1a31d70f02b 100644 +index 031280d62196aee200a74f3e43191645f9ae4244..66bb18fddb8a3b35903c336a97cfea6014cf265d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -3457,31 +3457,31 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/1011-Use-Velocity-compression-and-cipher-natives.patch b/patches/server/1011-Use-Velocity-compression-and-cipher-natives.patch index 95f9b5544d0c..72aad8bf59e1 100644 --- a/patches/server/1011-Use-Velocity-compression-and-cipher-natives.patch +++ b/patches/server/1011-Use-Velocity-compression-and-cipher-natives.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Use Velocity compression and cipher natives diff --git a/build.gradle.kts b/build.gradle.kts -index 9b9e744d18cf66279f51f950b6ecce31415f9fa8..5d448d8a7cf6626a11791f30ad52baf41a099272 100644 +index d8621fa86ca8677d707afdabebd289bbf2132ec5..f75d61a5f3d1903219c21784b4d8d7d14f8b8824 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -37,6 +37,11 @@ dependencies { +@@ -38,6 +38,11 @@ dependencies { runtimeOnly("org.xerial:sqlite-jdbc:3.45.3.0") runtimeOnly("com.mysql:mysql-connector-j:8.3.0") runtimeOnly("com.lmax:disruptor:3.4.4") // Paper diff --git a/patches/server/1029-Fix-and-optimise-world-force-upgrading.patch b/patches/server/1029-Fix-and-optimise-world-force-upgrading.patch index 3e94098edd1d..c7dd458bd855 100644 --- a/patches/server/1029-Fix-and-optimise-world-force-upgrading.patch +++ b/patches/server/1029-Fix-and-optimise-world-force-upgrading.patch @@ -260,10 +260,10 @@ index 0000000000000000000000000000000000000000..e049fbe4038aaea896f45b11ce9ce8f0 + } +} diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 244a19ecd0234fa1d7a6ecfea20751595688605d..5443013060b62e3bfcc51cddca96d1c0bc59fe72 100644 +index 81b00b4329f17f53c8543d08ef07fb6033b8b8e3..a23c603b08dde5b08a5f9f99081917a53cafecf7 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -392,6 +392,15 @@ public class Main { +@@ -414,6 +414,15 @@ public class Main { return new WorldLoader.InitConfig(worldloader_d, Commands.CommandSelection.DEDICATED, serverPropertiesHandler.functionPermissionLevel); } @@ -365,7 +365,7 @@ index 249705ec1b8b692ef1d7fec34a04918afe6486bc..f6e3b745fc417354380d4a969f83aee4 return this.regionCache.getAndMoveToFirst(ChunkPos.asLong(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ())); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index dd546e0680496d0626972b61b0eb183b07df0e6e..05e304f9fc8d0291fa779da589bd060ef4165b49 100644 +index 960f52b2724ab07bd3c7e9d0d874456b6a3b091e..57db399bc1d3b6b015740b059987bc8d9bcc3101 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1365,9 +1365,7 @@ public final class CraftServer implements Server { From 6723f5498616da919762c68978e13c518943ef40 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Mon, 8 Jul 2024 22:28:52 +0100 Subject: [PATCH 2/2] Stick to Jansi for now --- ...ConsoleAppender-for-console-improvements.patch | 15 ++++++++++----- ...lugin-prefixes-using-Log4J-configuration.patch | 6 +++--- ...ender-to-keep-logging-IO-off-main-thread.patch | 4 ++-- ...stacktraces-in-log-messages-crash-report.patch | 4 ++-- patches/server/0020-Plugin-remapping.patch | 6 +++--- ...lection-calls-in-plugins-using-internals.patch | 4 ++-- .../0034-Expose-server-build-information.patch | 4 ++-- patches/server/0356-Implement-Mob-Goal-API.patch | 4 ++-- .../0706-Add-support-for-Proxy-Protocol.patch | 4 ++-- ...-Velocity-compression-and-cipher-natives.patch | 4 ++-- 10 files changed, 30 insertions(+), 25 deletions(-) diff --git a/patches/server/0011-Use-TerminalConsoleAppender-for-console-improvements.patch b/patches/server/0011-Use-TerminalConsoleAppender-for-console-improvements.patch index 2d91782dbba0..97e1f14851fa 100644 --- a/patches/server/0011-Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/patches/server/0011-Use-TerminalConsoleAppender-for-console-improvements.patch @@ -25,10 +25,10 @@ Other changes: Co-Authored-By: Emilia Kond diff --git a/build.gradle.kts b/build.gradle.kts -index 94dfc105b197c9eda481cbe90bb48b71c845e702..86d62bc710d8794adebb60c82d82406a9cf54cb5 100644 +index 94dfc105b197c9eda481cbe90bb48b71c845e702..e5a897eaea50252b92fba674daf5d43c9c11d196 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -5,9 +5,30 @@ plugins { +@@ -5,9 +5,35 @@ plugins { `maven-publish` } @@ -42,8 +42,13 @@ index 94dfc105b197c9eda481cbe90bb48b71c845e702..86d62bc710d8794adebb60c82d82406a implementation(project(":paper-api")) - implementation("jline:jline:2.12.1") + // Paper start -+ //implementation("org.jline:jline-terminal-ffm:3.26.1") TODO: Investigate if this is broken with java 21 -+ implementation("org.jline:jline-terminal-jni:3.26.1") ++ // TODO: Look into these ++ //implementation("org.jline:jline-terminal-ffm:3.26.1") // Investigate if this is broken with java 21 ++ //implementation("org.jline:jline-terminal-jni:3.26.1") // check behavior of this in windows... ++ implementation("org.jline:jline-terminal-jansi:3.21.0") { ++ exclude("org.fusesource.jansi", "jansi") // J21 already bundles and even sometimes installs its own jansi ++ } ++ + implementation("net.minecrell:terminalconsoleappender:1.3.0") + implementation("net.kyori:adventure-text-serializer-ansi:4.17.0") // Keep in sync with adventureVersion from Paper-API build file + /* @@ -60,7 +65,7 @@ index 94dfc105b197c9eda481cbe90bb48b71c845e702..86d62bc710d8794adebb60c82d82406a implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") // Paper - remove exclusion implementation("org.ow2.asm:asm-commons:9.7") implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files -@@ -78,6 +99,19 @@ tasks.check { +@@ -78,6 +104,19 @@ tasks.check { dependsOn(scanJar) } // Paper end diff --git a/patches/server/0012-Handle-plugin-prefixes-using-Log4J-configuration.patch b/patches/server/0012-Handle-plugin-prefixes-using-Log4J-configuration.patch index 7b2e11f097b0..1dc5881569ff 100644 --- a/patches/server/0012-Handle-plugin-prefixes-using-Log4J-configuration.patch +++ b/patches/server/0012-Handle-plugin-prefixes-using-Log4J-configuration.patch @@ -15,10 +15,10 @@ This may cause additional prefixes to be disabled for plugins bypassing the plugin logger. diff --git a/build.gradle.kts b/build.gradle.kts -index 129d29deb929b3a26913a5a1bf9e9d6633884189..feaa89c8b653daadc1fc1d6054ba2b040e58f650 100644 +index e5a897eaea50252b92fba674daf5d43c9c11d196..7d2d248c059ffefb1b4430bba9df41da50a108c0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -24,7 +24,7 @@ dependencies { +@@ -29,7 +29,7 @@ dependencies { all its classes to check if they are plugins. Scanning takes about 1-2 seconds so adding this speeds up the server start. */ @@ -28,7 +28,7 @@ index 129d29deb929b3a26913a5a1bf9e9d6633884189..feaa89c8b653daadc1fc1d6054ba2b04 runtimeOnly(log4jPlugins.output) alsoShade(log4jPlugins.output) diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index 60e354fe1d32cd315ed42cea4484c83c4b5e7e25..899e85ea70edfb6553dc27462690da8caa793f77 100644 +index fbbc08c5a189b99f8047e0f0f5cd31101149dbec..b717c9d8b6edc2cafc9281140913b7bdb6108cf0 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java @@ -288,7 +288,7 @@ public class SpigotConfig diff --git a/patches/server/0014-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch b/patches/server/0014-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch index 7cffdc089edb..034da396b87d 100644 --- a/patches/server/0014-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch +++ b/patches/server/0014-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Use AsyncAppender to keep logging IO off main thread diff --git a/build.gradle.kts b/build.gradle.kts -index 5e9d25728d12e3631fbecdea9545ba6c752cfcf6..fdfad742a97d7c6357e1de0192feeb906e15ffdc 100644 +index 7d2d248c059ffefb1b4430bba9df41da50a108c0..9f8744781ce4084b9ddb916e91656c1f5e155b8e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -35,6 +35,7 @@ dependencies { +@@ -40,6 +40,7 @@ dependencies { implementation("commons-lang:commons-lang:2.6") runtimeOnly("org.xerial:sqlite-jdbc:3.46.0.0") runtimeOnly("com.mysql:mysql-connector-j:8.4.0") diff --git a/patches/server/0015-Deobfuscate-stacktraces-in-log-messages-crash-report.patch b/patches/server/0015-Deobfuscate-stacktraces-in-log-messages-crash-report.patch index 160b1bd06f1b..3fed7813edfb 100644 --- a/patches/server/0015-Deobfuscate-stacktraces-in-log-messages-crash-report.patch +++ b/patches/server/0015-Deobfuscate-stacktraces-in-log-messages-crash-report.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Deobfuscate stacktraces in log messages, crash reports, and diff --git a/build.gradle.kts b/build.gradle.kts -index fdfad742a97d7c6357e1de0192feeb906e15ffdc..7d3db5e39f33b73b852141c8b24c017e1b55ffb1 100644 +index 9f8744781ce4084b9ddb916e91656c1f5e155b8e..b9f82d5a13419dd823145283ea8a8fc24e724a4d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -46,6 +46,7 @@ dependencies { +@@ -51,6 +51,7 @@ dependencies { testImplementation("org.mockito:mockito-core:5.11.0") testImplementation("org.ow2.asm:asm-tree:9.7") testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest diff --git a/patches/server/0020-Plugin-remapping.patch b/patches/server/0020-Plugin-remapping.patch index 95a4bd3de087..2d615656bbdf 100644 --- a/patches/server/0020-Plugin-remapping.patch +++ b/patches/server/0020-Plugin-remapping.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Plugin remapping Co-authored-by: Nassim Jahnke diff --git a/build.gradle.kts b/build.gradle.kts -index 7d3db5e39f33b73b852141c8b24c017e1b55ffb1..2369b767cadcca95ba69f8b01b9cd90a9e254dc8 100644 +index b9f82d5a13419dd823145283ea8a8fc24e724a4d..c972a9b1a632f9e6a0873fe7d363c3b3c9e5f5fe 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -47,6 +47,7 @@ dependencies { +@@ -52,6 +52,7 @@ dependencies { testImplementation("org.ow2.asm:asm-tree:9.7") testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest implementation("net.neoforged:srgutils:1.0.9") // Paper - mappings handling @@ -17,7 +17,7 @@ index 7d3db5e39f33b73b852141c8b24c017e1b55ffb1..2369b767cadcca95ba69f8b01b9cd90a } paperweight { -@@ -165,20 +166,41 @@ val runtimeClasspathWithoutVanillaServer = configurations.runtimeClasspath.flatM +@@ -170,20 +171,41 @@ val runtimeClasspathWithoutVanillaServer = configurations.runtimeClasspath.flatM runtime.filterNot { it.asFile.absolutePath == vanilla } } diff --git a/patches/server/0022-Remap-reflection-calls-in-plugins-using-internals.patch b/patches/server/0022-Remap-reflection-calls-in-plugins-using-internals.patch index e97fb9b36aa6..34172199b47f 100644 --- a/patches/server/0022-Remap-reflection-calls-in-plugins-using-internals.patch +++ b/patches/server/0022-Remap-reflection-calls-in-plugins-using-internals.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Remap reflection calls in plugins using internals Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com> diff --git a/build.gradle.kts b/build.gradle.kts -index 2369b767cadcca95ba69f8b01b9cd90a9e254dc8..0badf522f5adb93af81950d48d12623318c06e78 100644 +index c972a9b1a632f9e6a0873fe7d363c3b3c9e5f5fe..696bada19a7d3449dfb525c255becbed825e5c16 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -48,6 +48,12 @@ dependencies { +@@ -53,6 +53,12 @@ dependencies { testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest implementation("net.neoforged:srgutils:1.0.9") // Paper - mappings handling implementation("net.neoforged:AutoRenamingTool:2.0.3") // Paper - remap plugins diff --git a/patches/server/0034-Expose-server-build-information.patch b/patches/server/0034-Expose-server-build-information.patch index 99fc66075b19..3540ec899959 100644 --- a/patches/server/0034-Expose-server-build-information.patch +++ b/patches/server/0034-Expose-server-build-information.patch @@ -11,7 +11,7 @@ Co-authored-by: Jake Potrebic Co-authored-by: masmc05 diff --git a/build.gradle.kts b/build.gradle.kts -index 0badf522f5adb93af81950d48d12623318c06e78..1c61eaf86a342345ec9bed3e666efbe2842f0111 100644 +index 696bada19a7d3449dfb525c255becbed825e5c16..ed2d66b44d701f9e2f30428b9f51d5dc03dc38a0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,5 @@ @@ -20,7 +20,7 @@ index 0badf522f5adb93af81950d48d12623318c06e78..1c61eaf86a342345ec9bed3e666efbe2 plugins { java -@@ -65,18 +66,24 @@ tasks.jar { +@@ -70,18 +71,24 @@ tasks.jar { manifest { val git = Git(rootProject.layout.projectDirectory.path) diff --git a/patches/server/0356-Implement-Mob-Goal-API.patch b/patches/server/0356-Implement-Mob-Goal-API.patch index e95df1b1b90d..aacf24dc45a6 100644 --- a/patches/server/0356-Implement-Mob-Goal-API.patch +++ b/patches/server/0356-Implement-Mob-Goal-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement Mob Goal API diff --git a/build.gradle.kts b/build.gradle.kts -index 1c61eaf86a342345ec9bed3e666efbe2842f0111..1196756613a9a2a0fc33367ccaca868e3cbb737d 100644 +index ed2d66b44d701f9e2f30428b9f51d5dc03dc38a0..ed7d58b45bfb0fb2b636ae5b1b057bdaec0347ac 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -42,6 +42,7 @@ dependencies { +@@ -47,6 +47,7 @@ dependencies { runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18") runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18") diff --git a/patches/server/0706-Add-support-for-Proxy-Protocol.patch b/patches/server/0706-Add-support-for-Proxy-Protocol.patch index be625da89ee2..8fc8b29bad6f 100644 --- a/patches/server/0706-Add-support-for-Proxy-Protocol.patch +++ b/patches/server/0706-Add-support-for-Proxy-Protocol.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add support for Proxy Protocol diff --git a/build.gradle.kts b/build.gradle.kts -index 1196756613a9a2a0fc33367ccaca868e3cbb737d..c5763b1ade6dbc806ab579be2f2a9cfcca0e0c33 100644 +index ed7d58b45bfb0fb2b636ae5b1b057bdaec0347ac..28d25e6821f4e8ce9253a8025dc4094e6cacd0fa 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -29,6 +29,7 @@ dependencies { +@@ -34,6 +34,7 @@ dependencies { log4jPlugins.annotationProcessorConfigurationName("org.apache.logging.log4j:log4j-core:2.19.0") // Paper - Needed to generate meta for our Log4j plugins runtimeOnly(log4jPlugins.output) alsoShade(log4jPlugins.output) diff --git a/patches/server/1006-Use-Velocity-compression-and-cipher-natives.patch b/patches/server/1006-Use-Velocity-compression-and-cipher-natives.patch index a2f414a3ad18..f24145a5b31f 100644 --- a/patches/server/1006-Use-Velocity-compression-and-cipher-natives.patch +++ b/patches/server/1006-Use-Velocity-compression-and-cipher-natives.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Use Velocity compression and cipher natives diff --git a/build.gradle.kts b/build.gradle.kts -index c5763b1ade6dbc806ab579be2f2a9cfcca0e0c33..5e427cbc1c371cb800a6812a6ac9a9bf5fcc4290 100644 +index 28d25e6821f4e8ce9253a8025dc4094e6cacd0fa..a73ac2d5d2bcaeb046ab76e06dfcd5a68a70a2f3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -38,6 +38,11 @@ dependencies { +@@ -43,6 +43,11 @@ dependencies { runtimeOnly("org.xerial:sqlite-jdbc:3.46.0.0") runtimeOnly("com.mysql:mysql-connector-j:8.4.0") runtimeOnly("com.lmax:disruptor:3.4.4") // Paper