From 11e42875994a12108517c1d249a2d54b3f124874 Mon Sep 17 00:00:00 2001 From: PikaMug <2267126+PikaMug@users.noreply.github.com> Date: Thu, 3 Jun 2021 01:02:02 -0400 Subject: [PATCH] Extend optional MySQL implementation, part 2. See #312 and #1707 --- main/src/main/java/me/blackvein/quests/Quester.java | 2 +- .../storage/implementation/file/SeparatedYamlStorage.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/main/src/main/java/me/blackvein/quests/Quester.java b/main/src/main/java/me/blackvein/quests/Quester.java index 85dc38ad7..fa9149055 100644 --- a/main/src/main/java/me/blackvein/quests/Quester.java +++ b/main/src/main/java/me/blackvein/quests/Quester.java @@ -3431,7 +3431,7 @@ public class Quester implements Comparable { plugin.getLogger().severe("Quest name was null or empty while loading data"); return null; } - final ConfigurationSection questSec = dataSec.createSection(quest.getName()); + final ConfigurationSection questSec = dataSec.createSection(quest.getId()); final QuestData questData = getQuestData(quest); if (questData == null) continue; diff --git a/main/src/main/java/me/blackvein/quests/storage/implementation/file/SeparatedYamlStorage.java b/main/src/main/java/me/blackvein/quests/storage/implementation/file/SeparatedYamlStorage.java index 879fba527..d32246d57 100644 --- a/main/src/main/java/me/blackvein/quests/storage/implementation/file/SeparatedYamlStorage.java +++ b/main/src/main/java/me/blackvein/quests/storage/implementation/file/SeparatedYamlStorage.java @@ -164,7 +164,7 @@ public class SeparatedYamlStorage implements StorageImplementation { } for (final String key : dataSec.getKeys(false)) { final ConfigurationSection questSec = dataSec.getConfigurationSection(key); - final Quest quest = plugin.getQuest(key); + final Quest quest = plugin.getQuestById(key) != null ? plugin.getQuestById(key) : plugin.getQuest(key); Stage stage; if (quest == null || quester.getCurrentQuests().containsKey(quest) == false) { continue; @@ -177,8 +177,9 @@ public class SeparatedYamlStorage implements StorageImplementation { continue; } quester.addEmptiesFor(quest, quester.getCurrentQuests().get(quest)); - if (questSec == null) + if (questSec == null) { continue; + } if (questSec.contains("blocks-broken-names")) { final List names = questSec.getStringList("blocks-broken-names"); final List amounts = questSec.getIntegerList("blocks-broken-amounts");