[SPIGOT-6502] Plugins can't load libraries from their transitive depends Created: 10/Jun/21  Updated: 11/Jun/21  Resolved: 11/Jun/21

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Leonhard Solbach Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: bug, bukkit, spigot
Environment:

 


Version: 1.16.5
Guidelines Read: Yes

 Description   

146a7e4bd76 adds library support, like on BungeeCord.
This feature works brilliantly on BungeeCord, however, it does not on Spigot:
If a plugin loads a class of a library it is dependent on a ClassCastException is thrown.
This is because Spigot expects the Classloader of a class loaded from another PluginClassloader to be an instance of PluginClassLoader as well see:
 
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/browse/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java#119
 
If this check would only apply if the Classloader of the given class is a PluginClassloader the classloading would work as well as on BungeeCord


Generated at Sat Mar 29 12:01:25 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.