forked from Upstream/mmocore
Debug for MMOCore skill Tree. When creating nodes and using /mmocore reload
This commit is contained in:
parent
6965ebafcf
commit
aa90e9bc6c
@ -382,11 +382,6 @@ public class MMOCore extends JavaPlugin {
|
||||
|
||||
if (clearBefore)
|
||||
PlayerData.getAll().forEach(PlayerData::update);
|
||||
else
|
||||
//We update the skill tree data if some new skill tree has been
|
||||
// created and updated with the /mmocore reload command.
|
||||
PlayerData.getAll().forEach(PlayerData::updateSkillTree);
|
||||
|
||||
}
|
||||
|
||||
public static void log(String message) {
|
||||
|
@ -172,11 +172,20 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc
|
||||
} finally {
|
||||
j++;
|
||||
}
|
||||
|
||||
for(SkillTree skillTree:profess.getSkillTrees()) {
|
||||
for(SkillTreeNode node: skillTree.getNodes()) {
|
||||
if(!nodeLevels.containsKey(node))
|
||||
nodeLevels.put(node,0);
|
||||
}
|
||||
}
|
||||
|
||||
setupSkillTree();
|
||||
}
|
||||
|
||||
public void setupSkillTree() {
|
||||
//Node states setup
|
||||
for (SkillTree skillTree : MMOCore.plugin.skillTreeManager.getAll())
|
||||
for (SkillTree skillTree : profess.getSkillTrees())
|
||||
skillTree.setupNodeState(this);
|
||||
|
||||
|
||||
@ -345,18 +354,6 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc
|
||||
skillTree.setupNodeState(this);
|
||||
}
|
||||
|
||||
|
||||
public void updateSkillTree() {
|
||||
nodeStates.clear();
|
||||
for (SkillTree tree : profess.getSkillTrees()) {
|
||||
for (SkillTreeNode node : tree.getNodes()) {
|
||||
if (!nodeLevels.containsKey(node))
|
||||
nodeLevels.put(node, 0);
|
||||
}
|
||||
}
|
||||
setupSkillTree();
|
||||
}
|
||||
|
||||
public Map<SkillTreeNode, NodeState> getNodeStates() {
|
||||
return new HashMap<>(nodeStates);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user