Restore broken accept-timeout option, fixes #337

This commit is contained in:
HappyPikachu 2018-03-18 21:26:06 -04:00
parent edd26f4a77
commit 41c2103d3e

View File

@ -173,8 +173,6 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
pListener = new PlayerListener(this);
effListener = new NpcEffectThread(this);
npcListener = new NpcListener(this);
this.conversationFactory = new ConversationFactory(this).withModality(false).withPrefix(new QuestsPrefix()).withFirstPrompt(new QuestPrompt()).withTimeout(acceptTimeout).thatExcludesNonPlayersWithMessage("Console may not perform this conversation!").addConversationAbandonedListener(this);
this.NPCConversationFactory = new ConversationFactory(this).withModality(false).withFirstPrompt(new QuestAcceptPrompt(this)).withTimeout(acceptTimeout).withLocalEcho(false).addConversationAbandonedListener(this);
questFactory = new QuestFactory(this);
eventFactory = new EventFactory(this);
linkOtherPlugins();
@ -201,6 +199,10 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
getConfig().options().copyDefaults(true);
saveConfig();
//Setup conversation factory after timeout has loaded
this.conversationFactory = new ConversationFactory(this).withModality(false).withPrefix(new QuestsPrefix()).withFirstPrompt(new QuestPrompt()).withTimeout(acceptTimeout).thatExcludesNonPlayersWithMessage("Console may not perform this conversation!").addConversationAbandonedListener(this);
this.NPCConversationFactory = new ConversationFactory(this).withModality(false).withFirstPrompt(new QuestAcceptPrompt(this)).withTimeout(acceptTimeout).withLocalEcho(false).addConversationAbandonedListener(this);
getServer().getPluginManager().registerEvents(pListener, this);
if (npcEffects) {
getServer().getScheduler().scheduleSyncRepeatingTask(this, effListener, 20, 20);