Fixes class not found error.

https://github.com/BentoBoxWorld/bentobox/issues/360
This commit is contained in:
tastybento 2018-12-01 19:53:50 -08:00
parent 693c6ab17e
commit 3edfd62a6b

View File

@ -114,8 +114,12 @@ public class AddonsManager {
private void loadAddon(File f) { private void loadAddon(File f) {
Addon addon; Addon addon;
// try loading the addon try (JarFile jar = new JarFile(f)) {
try (JarFile jar = new JarFile(f); AddonClassLoader addonClassLoader = new AddonClassLoader(this, addonDescription(jar), f, this.getClass().getClassLoader())) { // try loading the addon
// Get description in the addon.yml file
YamlConfiguration data = addonDescription(jar);
// Load the addon
AddonClassLoader addonClassLoader = new AddonClassLoader(this, data, f, this.getClass().getClassLoader());
// Get the addon itself // Get the addon itself
addon = addonClassLoader.getAddon(); addon = addonClassLoader.getAddon();
// Initialize some settings // Initialize some settings