Paper/patches/api/0208-Provide-a-useful-PluginClassLoader-toString.patch
Shane Freeder 4276013833
Updated Upstream (Bukkit/CraftBukkit/Spigot)
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:
9590b610 SPIGOT-6749: Library Loader does not correctly isolate dependencies

CraftBukkit Changes:
11c9299f #940: Fixed a NPE during CraftBlockEntityState#update.
960f3109 #937: Fixes related to unplaced BlockStates and the recent world generation changes.
4faf479e SPIGOT-6754: We ignore any still present TileEntity now when we create a BlockState for a block of type AIR.
a72d5404 SPIGOT-6754: Temporarily restore previous behaviour for tile entities with removed blocks

Spigot Changes:
dc75aca8 Remove redundant 'Log null TileEntity Owner' patch
2021-10-15 12:43:19 +01:00

31 lines
1.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sun, 31 May 2020 15:26:17 +0100
Subject: [PATCH] Provide a useful PluginClassLoader#toString
There are several cases where the plugin classloader may be dumped to the logs,
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 cd1907e8895ece9b780617635b71937596c0f982..9e14c95deaca0044a3e9284ceefbb2b5c54ede07 100644
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
@@ -235,4 +235,16 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot
javaPlugin.logger = this.logger; // Paper - set logger
javaPlugin.init(loader, loader.server, description, dataFolder, file, this);
}
+
+ // Paper start
+ @Override
+ public String toString() {
+ JavaPlugin currPlugin = plugin != null ? plugin : pluginInit;
+ return "PluginClassLoader{" +
+ "plugin=" + currPlugin +
+ ", pluginEnabled=" + (currPlugin == null ? "uninitialized" : currPlugin.isEnabled()) +
+ ", url=" + file +
+ '}';
+ }
+ // Paper end
}