Bug Fixing related to Skill Tree not working properly with MMOProfiles.

This commit is contained in:
Ka0rX 2023-06-01 08:41:30 +01:00
parent 178bb35d59
commit fb0dbad80f

View File

@ -267,7 +267,7 @@ public class PlayerData extends SynchronizedDataHolder implements OfflinePlayerD
NodeStatus nodeStatus = nodeStates.get(node); NodeStatus nodeStatus = nodeStates.get(node);
//Check the State of the node //Check the State of the node
if (nodeStatus != NodeStatus.UNLOCKED && nodeStatus != NodeStatus.UNLOCKABLE) return false; if (nodeStatus != NodeStatus.UNLOCKED && nodeStatus != NodeStatus.UNLOCKABLE) return false;
return node.hasPermissionRequirement(this)&&getNodeLevel(node) < node.getMaxLevel() && (skillTreePoints.getOrDefault(node.getTree().getId(), 0) + skillTreePoints.getOrDefault("global", 0) >= node.getSkillTreePointsConsumed()); return node.hasPermissionRequirement(this) && getNodeLevel(node) < node.getMaxLevel() && (skillTreePoints.getOrDefault(node.getTree().getId(), 0) + skillTreePoints.getOrDefault("global", 0) >= node.getSkillTreePointsConsumed());
} }
/** /**
@ -1086,7 +1086,7 @@ public class PlayerData extends SynchronizedDataHolder implements OfflinePlayerD
* *
* @return If the player unlocked the skill * @return If the player unlocked the skill
*/ */
public boolean hasUnlockedLevel(ClassSkill skill){ public boolean hasUnlockedLevel(ClassSkill skill) {
return getLevel() >= skill.getUnlockLevel(); return getLevel() >= skill.getUnlockLevel();
} }
@ -1129,6 +1129,8 @@ public class PlayerData extends SynchronizedDataHolder implements OfflinePlayerD
boundSkills.forEach((slot, info) -> info.close()); boundSkills.forEach((slot, info) -> info.close());
boundSkills.clear(); boundSkills.clear();
//Update skill tree.
setupSkillTree();
// Update stats // Update stats
if (isOnline()) getStats().updateStats(); if (isOnline()) getStats().updateStats();
} }