Fix mcMMO saving copies of config files into the main server directory instead of the correct place

This commit is contained in:
nossr50
2021-04-09 10:19:34 -07:00
parent 6d057c577e
commit c1c32cb1fd
13 changed files with 64 additions and 49 deletions

View File

@ -17,12 +17,12 @@ public class ChildConfig extends AutoUpdateConfigLoader {
@Override
protected void loadKeys() {
config.setDefaults(YamlConfiguration.loadConfiguration(plugin.getResourceAsReader("child.yml")));
config.setDefaults(YamlConfiguration.loadConfiguration(mcMMO.p.getResourceAsReader("child.yml")));
FamilyTree.clearRegistrations(); // when reloading, need to clear statics
for (PrimarySkillType skill : mcMMO.p.getSkillTools().CHILD_SKILLS) {
plugin.debug("Finding parents of " + skill.name());
mcMMO.p.debug("Finding parents of " + skill.name());
EnumSet<PrimarySkillType> parentSkills = EnumSet.noneOf(PrimarySkillType.class);
boolean useDefaults = false; // If we had an error we back out and use defaults
@ -34,7 +34,7 @@ public class ChildConfig extends AutoUpdateConfigLoader {
parentSkills.add(parentSkill);
}
catch (IllegalArgumentException ex) {
plugin.getLogger().warning(name + " is not a valid skill type, or is a child skill!");
mcMMO.p.getLogger().warning(name + " is not a valid skill type, or is a child skill!");
useDefaults = true;
break;
}
@ -53,7 +53,7 @@ public class ChildConfig extends AutoUpdateConfigLoader {
// Register them
for (PrimarySkillType parentSkill : parentSkills) {
plugin.debug("Registering " + parentSkill.name() + " as parent of " + skill.name());
mcMMO.p.debug("Registering " + parentSkill.name() + " as parent of " + skill.name());
FamilyTree.registerParent(skill, parentSkill);
}
}