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.
This commit is contained in:
parent
c649585082
commit
e04368045e
7 changed files with 15 additions and 15 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue