From 79e6995c7a97a3a4826cfe951693faa5a2cf7a8d Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 12 Oct 2021 11:38:37 +0200 Subject: [PATCH] Fix paper + paper java 16 support --- .../0567-Java-16-compatibility.patch | 40 +++++++++++++++++++ .../0567-Undo-partial-0004-MC-Utils.patch | 24 ----------- .../0568-Revert-paper-timing-changes.patch | 19 +++++++++ 3 files changed, 59 insertions(+), 24 deletions(-) create mode 100644 Paper/SteamWar-Patches/0567-Java-16-compatibility.patch delete mode 100644 Paper/SteamWar-Patches/0567-Undo-partial-0004-MC-Utils.patch create mode 100644 Paper/SteamWar-Patches/0568-Revert-paper-timing-changes.patch diff --git a/Paper/SteamWar-Patches/0567-Java-16-compatibility.patch b/Paper/SteamWar-Patches/0567-Java-16-compatibility.patch new file mode 100644 index 0000000..0c2162b --- /dev/null +++ b/Paper/SteamWar-Patches/0567-Java-16-compatibility.patch @@ -0,0 +1,40 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lixfel +Date: Tue, 12 Oct 2021 11:32:24 +0200 +Subject: [PATCH] Java 16 compatibility + + +diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java +index 2ea6f5b7da35cbb342e72a00ea70fef667f05d49..44ca5cd06c64c58aa511c589a401762c02201934 100644 +--- a/src/main/java/org/bukkit/craftbukkit/Main.java ++++ b/src/main/java/org/bukkit/craftbukkit/Main.java +@@ -204,12 +204,6 @@ public class Main { + return; + } + +- float javaVersion = Float.parseFloat(System.getProperty("java.class.version")); +- if (javaVersion > 58.0) { +- System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 14 is supported."); +- if (!Boolean.getBoolean("Paper.IgnoreJavaVersion")) return; // Paper +- } +- + try { + // Paper start - Handled by TerminalConsoleAppender + /* +diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +index 004b6ce132f8a686116b2a03a0a57461c8e164cf..807e8fcc7a0b2a6607d1d307fa8e71f5e3279772 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +@@ -295,12 +295,6 @@ public final class CraftMagicNumbers implements UnsafeValues { + + @Override + public byte[] processClass(PluginDescriptionFile pdf, String path, byte[] clazz) { +- try { +- clazz = Commodore.convert(clazz, !isLegacy(pdf)); +- } catch (Exception ex) { +- Bukkit.getLogger().log(Level.SEVERE, "Fatal error trying to convert " + pdf.getFullName() + ":" + path, ex); +- } +- + return clazz; + } + diff --git a/Paper/SteamWar-Patches/0567-Undo-partial-0004-MC-Utils.patch b/Paper/SteamWar-Patches/0567-Undo-partial-0004-MC-Utils.patch deleted file mode 100644 index 6e2d1fd..0000000 --- a/Paper/SteamWar-Patches/0567-Undo-partial-0004-MC-Utils.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: yoyonow -Date: Wed, 16 Jun 2021 20:56:09 +0200 -Subject: [PATCH] Undo partial 'Paper/Spigot-Server-Patches/0004-MC-Utils.patch' - ---- - SystemUtils.java | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/main/java/net/minecraft/SystemUtils.java b/src/main/java/net/minecraft/SystemUtils.java -index b0746aa..b4cb8a9 100644 ---- a/src/main/java/net/minecraft/SystemUtils.java -+++ b/src/main/java/net/minecraft/SystemUtils.java -@@ -64,7 +64,7 @@ public class SystemUtils { - } - - public static long getMonotonicNanos() { -- return System.nanoTime(); -+ return a.getAsLong(); - } - - public static long getTimeMillis() { --- - diff --git a/Paper/SteamWar-Patches/0568-Revert-paper-timing-changes.patch b/Paper/SteamWar-Patches/0568-Revert-paper-timing-changes.patch new file mode 100644 index 0000000..8a6fbe2 --- /dev/null +++ b/Paper/SteamWar-Patches/0568-Revert-paper-timing-changes.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lixfel +Date: Tue, 12 Oct 2021 11:36:45 +0200 +Subject: [PATCH] Revert paper timing changes + + +diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java +index aa399e7f6518ff70f2214161319170b1fc911751..0836606e21bb491808445b41eaaa1cacac07ef93 100644 +--- a/src/main/java/net/minecraft/server/SystemUtils.java ++++ b/src/main/java/net/minecraft/server/SystemUtils.java +@@ -58,7 +58,7 @@ public class SystemUtils { + } + + public static long getMonotonicNanos() { +- return System.nanoTime(); // Paper ++ return a.getAsLong(); + } + + public static long getTimeMillis() {