mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 00:47:42 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes:4276013833Updated Upstream (Bukkit/CraftBukkit/Spigot)5344798579Clean plugin folder logic in extra-jars patch (Fixes #6347) (#6619)3f2159e43cUnlimited chunk load rate (#6768)fc0e6c7e08Fix off by one for determining server view distance0a16fb8182Fix merchant inventories not closing on entity removal (#6544)c1644521c9Do not overload I/O threads with chunk data while flush saving
59 lines
2.6 KiB
Diff
59 lines
2.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Paul Sauve <paul@technove.co>
|
|
Date: Sat, 19 Dec 2020 19:06:37 -0600
|
|
Subject: [PATCH] Airplane API Changes
|
|
|
|
Copyright (C) 2020 Technove LLC
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
|
|
index 8a39c48fce819d72a94d5309db8dfc42930989af..4c84e3a5c983b7f8fe5515fff6fcfa64106150d2 100644
|
|
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
|
|
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
|
|
@@ -46,6 +46,8 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot
|
|
private final Set<String> seenIllegalAccess = Collections.newSetFromMap(new ConcurrentHashMap<>());
|
|
private java.util.logging.Logger logger; // Paper - add field
|
|
|
|
+ private boolean closed = false; // Airplane
|
|
+
|
|
static {
|
|
ClassLoader.registerAsParallelCapable();
|
|
}
|
|
@@ -151,6 +153,7 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot
|
|
throw new ClassNotFoundException(name);
|
|
}
|
|
|
|
+ public boolean _airplane_hasClass(@NotNull String name) { return this.classes.containsKey(name); } // Airplane
|
|
@Override
|
|
protected Class<?> findClass(String name) throws ClassNotFoundException {
|
|
if (name.startsWith("org.bukkit.") || name.startsWith("net.minecraft.")) {
|
|
@@ -158,7 +161,7 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot
|
|
}
|
|
Class<?> result = classes.get(name);
|
|
|
|
- if (result == null) {
|
|
+ if (result == null && !this.closed) { // Airplane
|
|
String path = name.replace('.', '/').concat(".class");
|
|
JarEntry entry = jar.getJarEntry(path);
|
|
|
|
@@ -213,6 +216,7 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot
|
|
try {
|
|
super.close();
|
|
} finally {
|
|
+ this.closed = true; // Airplane
|
|
jar.close();
|
|
}
|
|
}
|