Files
Purpur/patches/api/0001-Airplane-API-Changes.patch
William Blake Galbreath db65efba2b Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
4276013833 Updated Upstream (Bukkit/CraftBukkit/Spigot)
5344798579 Clean plugin folder logic in extra-jars patch (Fixes #6347) (#6619)
3f2159e43c Unlimited chunk load rate (#6768)
fc0e6c7e08 Fix off by one for determining server view distance
0a16fb8182 Fix merchant inventories not closing on entity removal (#6544)
c1644521c9 Do not overload I/O threads with chunk data while flush saving
2021-10-16 12:56:35 -05:00

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();
}
}