From 455f6bc8c31335195cb18462a19b1edcdb3163b8 Mon Sep 17 00:00:00 2001 From: Riley Park Date: Sat, 15 May 2021 15:56:38 -0700 Subject: [PATCH] Activate warning by default when people are doing silly things (#5642) --- Spigot-Server-Patches/Adventure.patch | 17 +++++++++++++++++ ...DK-per-thread-native-byte-buffer-cache.patch | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Spigot-Server-Patches/Adventure.patch b/Spigot-Server-Patches/Adventure.patch index 8a988a5ef2..8ae9a16fd1 100644 --- a/Spigot-Server-Patches/Adventure.patch +++ b/Spigot-Server-Patches/Adventure.patch @@ -1796,6 +1796,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } // Paper end } +diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/Main.java ++++ b/src/main/java/org/bukkit/craftbukkit/Main.java +@@ -0,0 +0,0 @@ public class Main { + public static boolean useConsole = true; + + public static void main(String[] args) { ++ // Paper start ++ final String warnWhenLegacyFormattingDetected = String.join(".", "net", "kyori", "adventure", "text", "warnWhenLegacyFormattingDetected"); ++ if (System.getProperty(warnWhenLegacyFormattingDetected) == null) { ++ System.setProperty(warnWhenLegacyFormattingDetected, String.valueOf(true)); ++ } ++ // Paper end + // Todo: Installation script + OptionParser parser = new OptionParser() { + { diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java diff --git a/Spigot-Server-Patches/Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch b/Spigot-Server-Patches/Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch index f397ffbbd6..86f387b8e6 100644 --- a/Spigot-Server-Patches/Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch +++ b/Spigot-Server-Patches/Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch @@ -21,8 +21,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -0,0 +0,0 @@ public class Main { - - public static void main(String[] args) { + } + // Paper end // Todo: Installation script + if (System.getProperty("jdk.nio.maxCachedBufferSize") == null) System.setProperty("jdk.nio.maxCachedBufferSize", "262144"); // Paper - cap per-thread NIO cache size OptionParser parser = new OptionParser() {