-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
Windows 10
Java 17.0.1
-
CraftBukkit version 3508-Spigot-fa893f0-50ef122 (MC: 1.19) (Implementing API version 1.19-R0.1-SNAPSHOT)
-
Yes
Presuming a plugin declares a library in the plugin.yml file. If the plugin, or the library decides to invoke JavaPlugin#getProvidingPlugin, where the passed class is a class from one of the libraries declared in the plugin.yml file. The result is that an instance of IllegalArgumentException yields.
For example the library IF (com.github.stefvanschie.inventoryframework:IF:0.10.6), was used, which itself uses JavaPlugin#getProvidingPlugin on one of its own classes. This would work with the assumption that the library gets directly shaded into the jar, thus directly loaded by the a plugin's classloader. But when instead declaring it in plugin.yml the library gets loaded with an instance of LibraryLoader which does not instanceof PluginClassLoader thus fails the check on line 423 in JavaPlugin.
- duplicates
-
SPIGOT-7012 JavaPlugin.getProvidingPlugin(Class) does not work from the libraries section
- Open