From e04368045e2fe8e53a7b686e9bfb7c41766267be Mon Sep 17 00:00:00 2001 From: Jake Potrebic <15055071+Machine-Maker@users.noreply.github.com> Date: Thu, 10 Jun 2021 21:35:13 -0700 Subject: [PATCH] Updated Upstream (Bukkit/CraftBukkit) (#5794) Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 7e29f765 SPIGOT-6502: Loading a class from a library of another plugin resulted in a ClassCastException. CraftBukkit Changes: 296df566 Remove outdated build delay. --- ...karound-for-plugins-modifying-the-parent-of-t.patch | 4 ++-- .../0205-Prioritise-own-classes-where-possible.patch | 10 +++++----- ...7-Provide-a-useful-PluginClassLoader-toString.patch | 4 ++-- Spigot-Server-Patches/0001-POM-Changes.patch | 4 ++-- ...minalConsoleAppender-for-console-improvements.patch | 4 ++-- work/Bukkit | 2 +- work/CraftBukkit | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Spigot-API-Patches/0068-Add-workaround-for-plugins-modifying-the-parent-of-t.patch b/Spigot-API-Patches/0068-Add-workaround-for-plugins-modifying-the-parent-of-t.patch index af5715219..47b6099ab 100644 --- a/Spigot-API-Patches/0068-Add-workaround-for-plugins-modifying-the-parent-of-t.patch +++ b/Spigot-API-Patches/0068-Add-workaround-for-plugins-modifying-the-parent-of-t.patch @@ -87,7 +87,7 @@ index bb2e55e97bf887a28cac7d4f9a0a23960d22cf56..04fa3991f6ce4e9dad804f28fc6c9476 /** diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -index 5ffa98bb9c76d802a9d0ea6c572a704a2732c67c..22abd85da592c79e312928de596e5d552a45ef12 100644 +index 13100c688bfccb826b3072aaa92901f8634cf9ab..b9766b9b47547c400ed075f1635bb1461cb5e860 100644 --- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java @@ -44,6 +44,7 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot @@ -107,7 +107,7 @@ index 5ffa98bb9c76d802a9d0ea6c572a704a2732c67c..22abd85da592c79e312928de596e5d55 try { Class jarClass; try { -@@ -220,6 +223,7 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot +@@ -222,6 +225,7 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot pluginState = new IllegalStateException("Initial initialization"); this.pluginInit = javaPlugin; diff --git a/Spigot-API-Patches/0205-Prioritise-own-classes-where-possible.patch b/Spigot-API-Patches/0205-Prioritise-own-classes-where-possible.patch index 4603ec725..be1c895ad 100644 --- a/Spigot-API-Patches/0205-Prioritise-own-classes-where-possible.patch +++ b/Spigot-API-Patches/0205-Prioritise-own-classes-where-possible.patch @@ -63,7 +63,7 @@ index ce751577623eaad0f31e2eb7bf0842d1ab73e845..31793f46e5623729dfb4048e901f2740 for (PluginClassLoader loader : loaders) { try { diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -index 22abd85da592c79e312928de596e5d552a45ef12..cfa408e560d85311b474562a6d3860363727eff0 100644 +index b9766b9b47547c400ed075f1635bb1461cb5e860..87016d01640d8ea86b93cf2f7ead4c88b6d9d778 100644 --- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java @@ -33,7 +33,7 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot @@ -75,12 +75,12 @@ index 22abd85da592c79e312928de596e5d552a45ef12..cfa408e560d85311b474562a6d386036 private final File dataFolder; private final File file; private final JarFile jar; -@@ -117,7 +117,7 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot - } +@@ -118,7 +118,7 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot if (checkGlobal) { + // This ignores the libraries of other plugins, unless they are transitive dependencies. - Class result = loader.getClassByName(name, resolve, description); + Class result = loader.getClassByName(name, resolve, description, this); // Paper - prioritize self - if (result != null) { - PluginDescriptionFile provider = ((PluginClassLoader) result.getClassLoader()).description; + // If the class was loaded from a library instead of a PluginClassLoader, we can assume that its associated plugin is a transitive dependency and can therefore skip this check. + if (result != null && result.getClassLoader() instanceof PluginClassLoader) { diff --git a/Spigot-API-Patches/0207-Provide-a-useful-PluginClassLoader-toString.patch b/Spigot-API-Patches/0207-Provide-a-useful-PluginClassLoader-toString.patch index 43903ca4e..f993bdc2b 100644 --- a/Spigot-API-Patches/0207-Provide-a-useful-PluginClassLoader-toString.patch +++ b/Spigot-API-Patches/0207-Provide-a-useful-PluginClassLoader-toString.patch @@ -8,10 +8,10 @@ however, this provides no indication of the owner of the classloader, making these messages effectively useless, this patch rectifies this diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -index e7a8a221a23d2adc497afd21e512eecba4c63a6b..11e5618ff66385574ba04db0942a75227cf8eb0f 100644 +index 87016d01640d8ea86b93cf2f7ead4c88b6d9d778..cb62666d14a8eeb6338ecef75d57a1946cfa99a4 100644 --- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -@@ -226,4 +226,16 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot +@@ -228,4 +228,16 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot javaPlugin.logger = this.logger; // Paper - set logger javaPlugin.init(loader, loader.server, description, dataFolder, file, this); } diff --git a/Spigot-Server-Patches/0001-POM-Changes.patch b/Spigot-Server-Patches/0001-POM-Changes.patch index fd56507f9..8d0da0d54 100644 --- a/Spigot-Server-Patches/0001-POM-Changes.patch +++ b/Spigot-Server-Patches/0001-POM-Changes.patch @@ -264,13 +264,13 @@ index 3fc047371e8f8a626e69697fad549d689c5dce89..a5d87d22cb1588d15e08da3b37e51c5e org.codehaus.plexus diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 036c870d991118e5c09eced8485b94579bc6782a..c6417a0594ffe2d3650ec54d44e575e347a1f724 100644 +index 4452427d0a8298d119ca29ef397b7a94f19eec28..46a16e31775b28c44f95a8ac5545ebcb656c74b6 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -186,7 +186,7 @@ public class Main { } - if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { + if (false && Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { - Date buildDate = new Date(Integer.parseInt(Main.class.getPackage().getImplementationVendor()) * 1000L); + Date buildDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").parse(Main.class.getPackage().getImplementationVendor()); // Paper diff --git a/Spigot-Server-Patches/0146-Use-TerminalConsoleAppender-for-console-improvements.patch b/Spigot-Server-Patches/0146-Use-TerminalConsoleAppender-for-console-improvements.patch index 0209e853f..80016ae98 100644 --- a/Spigot-Server-Patches/0146-Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/Spigot-Server-Patches/0146-Use-TerminalConsoleAppender-for-console-improvements.patch @@ -300,7 +300,7 @@ index 0ed8e95d464cf17dc0355056775a9a375a4e7a86..2a05ef7553e3b05d5757e69e69c247e2 @Override public PluginCommand getPluginCommand(String name) { diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index f1f658a90dcbb8d0b26a22c632cd7172e5d206ef..f474220105f58e0a889c78ae0b11873369a7f402 100644 +index b849b2afd009da433fe6cea5837b3ee9bb5c52b4..60d9980ccca6f1ac55b70f7684b917ddceac380a 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -12,7 +12,7 @@ import java.util.logging.Level; @@ -339,7 +339,7 @@ index f1f658a90dcbb8d0b26a22c632cd7172e5d206ef..f474220105f58e0a889c78ae0b118733 + System.setProperty(TerminalConsoleAppender.JLINE_OVERRIDE_PROPERTY, "false"); // Paper } - if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { + if (false && Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { @@ -232,7 +243,7 @@ public class Main { System.out.println("Unable to read system info"); } diff --git a/work/Bukkit b/work/Bukkit index 04df07fe9..7e29f7654 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 04df07fe9a45f382bedd4ee83948382d3e7baae8 +Subproject commit 7e29f7654411f0a17ebbcc2c3f6a7dfe93bff39e diff --git a/work/CraftBukkit b/work/CraftBukkit index fae895ac1..296df5667 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit fae895ac110a830e4bbd5cc9eadbf70104ce215e +Subproject commit 296df56673771692593156995684ab8041925d9d