Delay loading of modules, just to be on the safe side. See #631

This commit is contained in:
BuildTools 2019-01-15 17:47:09 -05:00
parent 47be17c9f3
commit 1edc8913e4

View File

@ -157,8 +157,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
saveResourceAs("events.yml", "events.yml", false); saveResourceAs("events.yml", "events.yml", false);
saveResourceAs("data.yml", "data.yml", false); saveResourceAs("data.yml", "data.yml", false);
// 5 - Load other configs and modules // 5 - Load other configs
loadModules();
try { try {
setupLang(); setupLang();
} catch (IOException e) { } catch (IOException e) {
@ -184,6 +183,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
this.npcConversationFactory = new ConversationFactory(this).withModality(false).withFirstPrompt(new QuestAcceptPrompt(this)) this.npcConversationFactory = new ConversationFactory(this).withModality(false).withFirstPrompt(new QuestAcceptPrompt(this))
.withTimeout(settings.getAcceptTimeout()).withLocalEcho(false).addConversationAbandonedListener(this); .withTimeout(settings.getAcceptTimeout()).withLocalEcho(false).addConversationAbandonedListener(this);
// 9 - Register listeners
getServer().getPluginManager().registerEvents(playerListener, this); getServer().getPluginManager().registerEvents(playerListener, this);
if (depends.getCitizens() != null) { if (depends.getCitizens() != null) {
getServer().getPluginManager().registerEvents(npcListener, this); getServer().getPluginManager().registerEvents(npcListener, this);
@ -194,6 +194,8 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
if (depends.getPartiesApi() != null) { if (depends.getPartiesApi() != null) {
getServer().getPluginManager().registerEvents(partiesListener, this); getServer().getPluginManager().registerEvents(partiesListener, this);
} }
// 10 - Delay loading of Quests, Events and modules
delayLoadQuestInfo(); delayLoadQuestInfo();
} }
@ -434,6 +436,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
getLogger().log(Level.INFO, "" + events.size() + " Event(s) loaded."); getLogger().log(Level.INFO, "" + events.size() + " Event(s) loaded.");
getLogger().log(Level.INFO, "" + Lang.size() + " Phrase(s) loaded."); getLogger().log(Level.INFO, "" + Lang.size() + " Phrase(s) loaded.");
questers.addAll(getOnlineQuesters()); questers.addAll(getOnlineQuesters());
loadModules();
} }
}, 5L); }, 5L);
} }