From 3edfd62a6b836a7949e1233417d82b99acba6d62 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 1 Dec 2018 19:53:50 -0800 Subject: [PATCH] Fixes class not found error. https://github.com/BentoBoxWorld/bentobox/issues/360 --- .../world/bentobox/bentobox/managers/AddonsManager.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/world/bentobox/bentobox/managers/AddonsManager.java b/src/main/java/world/bentobox/bentobox/managers/AddonsManager.java index 1b1259250..531d055f4 100644 --- a/src/main/java/world/bentobox/bentobox/managers/AddonsManager.java +++ b/src/main/java/world/bentobox/bentobox/managers/AddonsManager.java @@ -114,8 +114,12 @@ public class AddonsManager { private void loadAddon(File f) { Addon addon; - // try loading the addon - try (JarFile jar = new JarFile(f); AddonClassLoader addonClassLoader = new AddonClassLoader(this, addonDescription(jar), f, this.getClass().getClassLoader())) { + try (JarFile jar = new JarFile(f)) { + // 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 addon = addonClassLoader.getAddon(); // Initialize some settings