Fixed bug that occured w/ perm stats when changing to a new class.

This commit is contained in:
Ka0rX 2023-03-02 21:31:42 +01:00
parent b3c3218d87
commit 6ac3267059
2 changed files with 9 additions and 0 deletions

View File

@ -222,6 +222,13 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc
public void clearSkillTreePoints() {
skillTreePoints.clear();
}
public void clearNodeTimesClaimed() {
Map<String, Integer> copy= new HashMap<>(tableItemClaims);
copy.forEach((str, val) -> {
if (str.startsWith(SkillTreeNode.KEY_PREFIX))
tableItemClaims.remove(str);
});
}
public Set<Map.Entry<String, Integer>> getNodeLevelsEntrySet() {
HashMap<String, Integer> nodeLevelsString = new HashMap<>();

View File

@ -213,6 +213,8 @@ public class SavedClassInformation {
while (player.hasSkillBound(0))
player.unbindSkill(0);
player.clearNodeTimesClaimed();
/*
* Reads this class info, applies it to the player. set class after