Extend optional MySQL implementation, part 2. See #312 and #1707

This commit is contained in:
PikaMug 2021-06-03 01:02:02 -04:00
parent 0b77293929
commit 11e4287599
2 changed files with 4 additions and 3 deletions

View File

@ -3431,7 +3431,7 @@ public class Quester implements Comparable<Quester> {
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;

View File

@ -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<String> names = questSec.getStringList("blocks-broken-names");
final List<Integer> amounts = questSec.getIntegerList("blocks-broken-amounts");