Skip to content

Commit

Permalink
Update AddOnManager.java
Browse files Browse the repository at this point in the history
  • Loading branch information
ItzOverLight committed Feb 13, 2023
1 parent 3f8fb15 commit b6ce249
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
}
}
Expand Down

0 comments on commit b6ce249

Please sign in to comment.