From 525c5b1540569fadb437e0ef9e17a7db8f10831d Mon Sep 17 00:00:00 2001 From: Indyuce Date: Fri, 24 Dec 2021 15:26:25 +0100 Subject: [PATCH] eh --- .../mmocore/manager/profession/ProfessionManager.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/Indyuce/mmocore/manager/profession/ProfessionManager.java b/src/main/java/net/Indyuce/mmocore/manager/profession/ProfessionManager.java index 6bee333a..15cc57bf 100644 --- a/src/main/java/net/Indyuce/mmocore/manager/profession/ProfessionManager.java +++ b/src/main/java/net/Indyuce/mmocore/manager/profession/ProfessionManager.java @@ -16,6 +16,11 @@ public class ProfessionManager implements MMOCoreManager { private final Map professions = new HashMap<>(); private final Set professionManagers = new HashSet<>(); + /** + * If it has been loaded at least once + */ + private boolean loadedOnce; + public void register(Profession profession) { professions.put(profession.getId(), profession); } @@ -54,11 +59,12 @@ public class ProfessionManager implements MMOCoreManager { professions.clear(); // Load default profession managers (can't be done on constructor because MMOCore.plugin is null) - if (professionManagers.isEmpty()) { + if (!loadedOnce) { registerProfessionManager(MMOCore.plugin.alchemyManager); registerProfessionManager(MMOCore.plugin.enchantManager); registerProfessionManager(MMOCore.plugin.fishingManager); registerProfessionManager(MMOCore.plugin.smithingManager); + loadedOnce = true; } professionManagers.forEach(manager -> manager.initialize(clearBefore));