diff --git a/src/main/java/me/overlight/powertools/spigot/AddOns/AddOnManager.java b/src/main/java/me/overlight/powertools/spigot/AddOns/AddOnManager.java index 4d4ee1d..ff88733 100644 --- a/src/main/java/me/overlight/powertools/spigot/AddOns/AddOnManager.java +++ b/src/main/java/me/overlight/powertools/spigot/AddOns/AddOnManager.java @@ -29,16 +29,17 @@ public static void registerAddOn(AddOn... addOn) { public static void unRegisterAddOn(AddOn... addOn) { try { - addOns.removeAll(Arrays.asList(addOn)); Arrays.asList(addOn).forEach(AddOn::onDisabled); + addOns.removeAll(Arrays.asList(addOn)); } catch (Exception ignored) { } } public static void unRegisterAll() { try { - addOns.forEach(AddOn::onDisabled); - addOns.clear(); + for (AddOn addon : addOns) { + unRegisterAddOn(addon); + } } catch (Exception ignored) { } }