Bug Fixing for Skill Tree

This commit is contained in:
Ka0rX 2023-05-07 16:50:43 +01:00
parent 8e504e1a10
commit a64faa02fd

View File

@ -19,15 +19,16 @@ public class CustomSkillTree extends SkillTree {
// Setup the children and parents for each node.
for (SkillTreeNode node : nodes.values()) {
for (String key : config.getConfigurationSection("nodes." + node.getId() + "parents").getKeys(false)) {
ConfigurationSection section = config.getConfigurationSection("nodes." + node.getId() + ".parents." + key);
if (section != null) {
for (String parent : section.getKeys(false)) {
node.addParent(getNode(parent), section.getInt(parent), ParentType.valueOf(UtilityMethods.enumName(key)));
getNode(parent).addChild(node);
if (config.isConfigurationSection("nodes." + node.getId() + ".children"))
for (String key : config.getConfigurationSection("nodes." + node.getId() + "parents").getKeys(false)) {
ConfigurationSection section = config.getConfigurationSection("nodes." + node.getId() + ".parents." + key);
if (section != null) {
for (String parent : section.getKeys(false)) {
node.addParent(getNode(parent), section.getInt(parent), ParentType.valueOf(UtilityMethods.enumName(key)));
getNode(parent).addChild(node);
}
}
}
}
}
setupRoots();
}