mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-02-12 18:31:56 +01:00
Use Bukkit loadPlugin for loading Pladdons
Provides compatibility with Paper. Ensured bytecode rewriting is done when code is loaded.
This commit is contained in:
parent
6894695024
commit
907268c2f4
@ -190,7 +190,7 @@ public class AddonsManager {
|
||||
private PladdonData loadPladdon(YamlConfiguration data, @NonNull File f) throws InvalidAddonInheritException, MalformedURLException, InvalidAddonDescriptionException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, InvalidDescriptionException {
|
||||
Addon addon = null;
|
||||
try {
|
||||
Plugin pladdon = pluginLoader.loadPlugin(f);
|
||||
Plugin pladdon = Bukkit.getPluginManager().loadPlugin(f);
|
||||
if (pladdon instanceof Pladdon pl) {
|
||||
addon = pl.getAddon();
|
||||
addon.setDescription(AddonClassLoader.asDescription(data));
|
||||
@ -202,6 +202,8 @@ public class AddonsManager {
|
||||
return new PladdonData(null, false);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
|
||||
ex.printStackTrace();
|
||||
// Addon not pladdon
|
||||
AddonClassLoader addonClassLoader = new AddonClassLoader(this, data, f, this.getClass().getClassLoader());
|
||||
// Get the addon itself
|
||||
|
Loading…
Reference in New Issue
Block a user