diff options
author | Jason Penilla <[email protected]> | 2024-05-22 11:27:21 -0700 |
---|---|---|
committer | Jason Penilla <[email protected]> | 2024-05-22 11:27:21 -0700 |
commit | 665c65b39e953ff253cc30cc20b8cc201073a33b (patch) | |
tree | fd9207ee4704e07fdc6efd714fabdf75e78381de | |
parent | 4eb282bb53fb6221a0761f03496938039d235a96 (diff) | |
download | Paper-665c65b39e953ff253cc30cc20b8cc201073a33b.tar.gz Paper-665c65b39e953ff253cc30cc20b8cc201073a33b.zip |
squash classloader diffs
-rw-r--r-- | patches/server/0019-Paper-Plugins.patch | 20 | ||||
-rw-r--r-- | patches/server/1046-Allow-Bukkit-plugin-to-use-Paper-PluginLoader-API.patch | 46 |
2 files changed, 14 insertions, 52 deletions
diff --git a/patches/server/0019-Paper-Plugins.patch b/patches/server/0019-Paper-Plugins.patch index 9b20647620..e5b13df65a 100644 --- a/patches/server/0019-Paper-Plugins.patch +++ b/patches/server/0019-Paper-Plugins.patch @@ -877,10 +877,10 @@ index 0000000000000000000000000000000000000000..f9a2c55a354c877749db3f92956de802 +} diff --git a/src/main/java/io/papermc/paper/plugin/entrypoint/classloader/PaperPluginClassLoader.java b/src/main/java/io/papermc/paper/plugin/entrypoint/classloader/PaperPluginClassLoader.java new file mode 100644 -index 0000000000000000000000000000000000000000..5a00e5c41274ded6b837fb81fa8f54616f2b7bc8 +index 0000000000000000000000000000000000000000..18401ede9cd1fc7094c6b74859929938e01795ca --- /dev/null +++ b/src/main/java/io/papermc/paper/plugin/entrypoint/classloader/PaperPluginClassLoader.java -@@ -0,0 +1,205 @@ +@@ -0,0 +1,209 @@ +package io.papermc.paper.plugin.entrypoint.classloader; + +import io.papermc.paper.plugin.configuration.PluginMeta; @@ -936,13 +936,17 @@ index 0000000000000000000000000000000000000000..5a00e5c41274ded6b837fb81fa8f5461 + this.libraryLoader = libraryLoader; + + this.logger = logger; -+ if (this.configuration.hasOpenClassloader()) { ++ if (this.configuration().hasOpenClassloader()) { + this.group = PaperClassLoaderStorage.instance().registerOpenGroup(this); + } + } + ++ private PaperPluginMeta configuration() { ++ return (PaperPluginMeta) this.configuration; ++ } ++ + public void refreshClassloaderDependencyTree(DependencyContext dependencyContext) { -+ if (this.configuration.hasOpenClassloader()) { ++ if (this.configuration().hasOpenClassloader()) { + return; + } + if (this.group != null) { @@ -1088,13 +1092,13 @@ index 0000000000000000000000000000000000000000..5a00e5c41274ded6b837fb81fa8f5461 +} diff --git a/src/main/java/io/papermc/paper/plugin/entrypoint/classloader/PaperSimplePluginClassLoader.java b/src/main/java/io/papermc/paper/plugin/entrypoint/classloader/PaperSimplePluginClassLoader.java new file mode 100644 -index 0000000000000000000000000000000000000000..a4c18063854e050bd0c54d488ceeda43c768b6df +index 0000000000000000000000000000000000000000..967465e542483e93a736129b5f5c6622cefd33fa --- /dev/null +++ b/src/main/java/io/papermc/paper/plugin/entrypoint/classloader/PaperSimplePluginClassLoader.java @@ -0,0 +1,116 @@ +package io.papermc.paper.plugin.entrypoint.classloader; + -+import io.papermc.paper.plugin.provider.configuration.PaperPluginMeta; ++import io.papermc.paper.plugin.configuration.PluginMeta; +import io.papermc.paper.plugin.util.NamespaceChecker; +import org.jetbrains.annotations.ApiStatus; + @@ -1120,13 +1124,13 @@ index 0000000000000000000000000000000000000000..a4c18063854e050bd0c54d488ceeda43 + ClassLoader.registerAsParallelCapable(); + } + -+ protected final PaperPluginMeta configuration; ++ protected final PluginMeta configuration; + protected final Path source; + protected final Manifest jarManifest; + protected final URL jarUrl; + protected final JarFile jar; + -+ public PaperSimplePluginClassLoader(Path source, JarFile file, PaperPluginMeta configuration, ClassLoader parentLoader) throws IOException { ++ public PaperSimplePluginClassLoader(Path source, JarFile file, PluginMeta configuration, ClassLoader parentLoader) throws IOException { + super(source.getFileName().toString(), new URL[]{source.toUri().toURL()}, parentLoader); + + this.source = source; diff --git a/patches/server/1046-Allow-Bukkit-plugin-to-use-Paper-PluginLoader-API.patch b/patches/server/1046-Allow-Bukkit-plugin-to-use-Paper-PluginLoader-API.patch index 858e08b881..59da8a4a9f 100644 --- a/patches/server/1046-Allow-Bukkit-plugin-to-use-Paper-PluginLoader-API.patch +++ b/patches/server/1046-Allow-Bukkit-plugin-to-use-Paper-PluginLoader-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow Bukkit plugin to use Paper PluginLoader API diff --git a/src/main/java/io/papermc/paper/plugin/entrypoint/classloader/PaperPluginClassLoader.java b/src/main/java/io/papermc/paper/plugin/entrypoint/classloader/PaperPluginClassLoader.java -index 5a00e5c41274ded6b837fb81fa8f54616f2b7bc8..9374a53dd1c161ee383044b965966e1083de8edf 100644 +index 18401ede9cd1fc7094c6b74859929938e01795ca..cc14e569d282ca53ce4237d3a57c764815502ddf 100644 --- a/src/main/java/io/papermc/paper/plugin/entrypoint/classloader/PaperPluginClassLoader.java +++ b/src/main/java/io/papermc/paper/plugin/entrypoint/classloader/PaperPluginClassLoader.java -@@ -48,18 +48,22 @@ public class PaperPluginClassLoader extends PaperSimplePluginClassLoader impleme +@@ -48,6 +48,10 @@ public class PaperPluginClassLoader extends PaperSimplePluginClassLoader impleme @Nullable private PluginClassLoaderGroup group; @@ -19,48 +19,6 @@ index 5a00e5c41274ded6b837fb81fa8f54616f2b7bc8..9374a53dd1c161ee383044b965966e10 public PaperPluginClassLoader(Logger logger, Path source, JarFile file, PaperPluginMeta configuration, ClassLoader parentLoader, URLClassLoader libraryLoader) throws IOException { super(source, file, configuration, parentLoader); this.libraryLoader = libraryLoader; - - this.logger = logger; -- if (this.configuration.hasOpenClassloader()) { -+ if (this.configuration().hasOpenClassloader()) { - this.group = PaperClassLoaderStorage.instance().registerOpenGroup(this); - } - } - - public void refreshClassloaderDependencyTree(DependencyContext dependencyContext) { -- if (this.configuration.hasOpenClassloader()) { -+ if (this.configuration().hasOpenClassloader()) { - return; - } - if (this.group != null) { -diff --git a/src/main/java/io/papermc/paper/plugin/entrypoint/classloader/PaperSimplePluginClassLoader.java b/src/main/java/io/papermc/paper/plugin/entrypoint/classloader/PaperSimplePluginClassLoader.java -index a4c18063854e050bd0c54d488ceeda43c768b6df..967465e542483e93a736129b5f5c6622cefd33fa 100644 ---- a/src/main/java/io/papermc/paper/plugin/entrypoint/classloader/PaperSimplePluginClassLoader.java -+++ b/src/main/java/io/papermc/paper/plugin/entrypoint/classloader/PaperSimplePluginClassLoader.java -@@ -1,6 +1,6 @@ - package io.papermc.paper.plugin.entrypoint.classloader; - --import io.papermc.paper.plugin.provider.configuration.PaperPluginMeta; -+import io.papermc.paper.plugin.configuration.PluginMeta; - import io.papermc.paper.plugin.util.NamespaceChecker; - import org.jetbrains.annotations.ApiStatus; - -@@ -26,13 +26,13 @@ public class PaperSimplePluginClassLoader extends URLClassLoader { - ClassLoader.registerAsParallelCapable(); - } - -- protected final PaperPluginMeta configuration; -+ protected final PluginMeta configuration; - protected final Path source; - protected final Manifest jarManifest; - protected final URL jarUrl; - protected final JarFile jar; - -- public PaperSimplePluginClassLoader(Path source, JarFile file, PaperPluginMeta configuration, ClassLoader parentLoader) throws IOException { -+ public PaperSimplePluginClassLoader(Path source, JarFile file, PluginMeta configuration, ClassLoader parentLoader) throws IOException { - super(source.getFileName().toString(), new URL[]{source.toUri().toURL()}, parentLoader); - - this.source = source; diff --git a/src/main/java/io/papermc/paper/plugin/loader/PaperClasspathBuilder.java b/src/main/java/io/papermc/paper/plugin/loader/PaperClasspathBuilder.java index f9d4b33050a6fe8c2dabe8e5eec075d95dc513e0..dc106685ecb483c33c06e4f83eda27be58251aad 100644 --- a/src/main/java/io/papermc/paper/plugin/loader/PaperClasspathBuilder.java |