mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 15:16:45 +01:00
Clear child skill FamilyTree on reload
This commit is contained in:
parent
1ca53da0e2
commit
fa34d06341
@ -18,6 +18,8 @@ public class ChildConfig extends AutoUpdateConfigLoader {
|
|||||||
protected void loadKeys() {
|
protected void loadKeys() {
|
||||||
config.setDefaults(YamlConfiguration.loadConfiguration(plugin.getResource("child.yml")));
|
config.setDefaults(YamlConfiguration.loadConfiguration(plugin.getResource("child.yml")));
|
||||||
|
|
||||||
|
FamilyTree.clearRegistrations(); // when reloading, need to clear statics
|
||||||
|
|
||||||
for (SkillType skill : SkillType.childSkills()) {
|
for (SkillType skill : SkillType.childSkills()) {
|
||||||
plugin.debug("Finding parents of " + skill.name());
|
plugin.debug("Finding parents of " + skill.name());
|
||||||
|
|
||||||
|
@ -35,6 +35,10 @@ public class FamilyTree {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected static void clearRegistrations() {
|
||||||
|
tree.clear();
|
||||||
|
}
|
||||||
|
|
||||||
protected static void enforceChildSkill(SkillType skill) {
|
protected static void enforceChildSkill(SkillType skill) {
|
||||||
if (!skill.isChildSkill()) {
|
if (!skill.isChildSkill()) {
|
||||||
throw new IllegalArgumentException(skill.name() + " is not a child skill!");
|
throw new IllegalArgumentException(skill.name() + " is not a child skill!");
|
||||||
|
Loading…
Reference in New Issue
Block a user