diff --git a/main/src/main/java/me/blackvein/quests/QuestFactory.java b/main/src/main/java/me/blackvein/quests/QuestFactory.java index f91dcfa1a..b039fcaee 100644 --- a/main/src/main/java/me/blackvein/quests/QuestFactory.java +++ b/main/src/main/java/me/blackvein/quests/QuestFactory.java @@ -73,11 +73,9 @@ public class QuestFactory implements ConversationAbandonedListener { private HashSet selectingNpcs = new HashSet(); private List names = new LinkedList(); private ConversationFactory convoCreator; - private File questsFile; public QuestFactory(Quests plugin) { this.plugin = plugin; - questsFile = new File(plugin.getDataFolder(), "quests.yml"); // Ensure to initialize convoCreator last so that 'this' is fully initialized before it is passed this.convoCreator = new ConversationFactory(plugin).withModality(false).withLocalEcho(false) .withFirstPrompt(new QuestMenuPrompt(plugin, null)).withTimeout(3600) @@ -1048,6 +1046,7 @@ public class QuestFactory implements ConversationAbandonedListener { private void deleteQuest(ConversationContext context) { YamlConfiguration data = new YamlConfiguration(); + File questsFile = new File(plugin.getDataFolder(), "quests.yml"); try { data.load(questsFile); } catch (IOException e) { diff --git a/main/src/main/java/me/blackvein/quests/actions/ActionFactory.java b/main/src/main/java/me/blackvein/quests/actions/ActionFactory.java index a3280a8cd..d02ef4e74 100644 --- a/main/src/main/java/me/blackvein/quests/actions/ActionFactory.java +++ b/main/src/main/java/me/blackvein/quests/actions/ActionFactory.java @@ -73,11 +73,9 @@ public class ActionFactory implements ConversationAbandonedListener { private Map selectedTeleportLocations = new HashMap(); private List names = new LinkedList(); private ConversationFactory convoCreator; - private File actionsFile; public ActionFactory(Quests plugin) { this.plugin = plugin; - actionsFile = new File(plugin.getDataFolder(), "actions.yml"); // Ensure to initialize convoCreator last so that 'this' is fully initialized before it is passed this.convoCreator = new ConversationFactory(plugin).withModality(false).withLocalEcho(false) .withPrefix(new QuestCreatorPrefix()).withFirstPrompt(new ActionMenuPrompt(plugin, null)) @@ -1140,8 +1138,8 @@ public class ActionFactory implements ConversationAbandonedListener { private void deleteAction(ConversationContext context) { YamlConfiguration data = new YamlConfiguration(); + File actionsFile = new File(plugin.getDataFolder(), "actions.yml"); try { - actionsFile = new File(plugin.getDataFolder(), "actions.yml"); data.load(actionsFile); } catch (IOException e) { e.printStackTrace(); @@ -1173,8 +1171,8 @@ public class ActionFactory implements ConversationAbandonedListener { private void saveAction(ConversationContext context) { YamlConfiguration data = new YamlConfiguration(); + File actionsFile = new File(plugin.getDataFolder(), "actions.yml"); try { - actionsFile = new File(plugin.getDataFolder(), "actions.yml"); data.load(actionsFile); } catch (IOException e) { e.printStackTrace();