Saves Bound Skills in YamlPlayerDataManager

This commit is contained in:
Ka0rX 2023-03-19 14:07:57 +01:00
parent 9e16e63bf5
commit ca7ee79c73
2 changed files with 5 additions and 2 deletions

View File

@ -155,6 +155,10 @@ public class SavedClassInformation {
registerSkillLevel(skill.getHandler().getId(), level); registerSkillLevel(skill.getHandler().getId(), level);
} }
public Map<Integer, String> getBoundSkills() {
return boundSkills;
}
public int getSkillTreeReallocationPoints() { public int getSkillTreeReallocationPoints() {
return skillTreeReallocationPoints; return skillTreeReallocationPoints;
} }

View File

@ -157,9 +157,7 @@ public class YAMLPlayerDataManager extends PlayerDataManager {
data.mapSkillLevels().forEach((key1, value) -> config.set("skill." + key1, value)); data.mapSkillLevels().forEach((key1, value) -> config.set("skill." + key1, value));
data.getItemClaims().forEach((key, times) -> config.set("times-claimed." + key, times)); data.getItemClaims().forEach((key, times) -> config.set("times-claimed." + key, times));
Map<Integer,String> boundSkills = new HashMap<>();
data.mapBoundSkills().forEach((slot,skill)->config.set("bound-skills."+slot,skill)); data.mapBoundSkills().forEach((slot,skill)->config.set("bound-skills."+slot,skill));
config.set("bound-skills", boundSkills);
config.set("attribute", null); config.set("attribute", null);
config.createSection("attribute"); config.createSection("attribute");
@ -191,6 +189,7 @@ public class YAMLPlayerDataManager extends PlayerDataManager {
info.getAttributeKeys().forEach(attribute -> config.set("class-info." + key + ".attribute." + attribute, info.getAttributeLevel(attribute))); info.getAttributeKeys().forEach(attribute -> config.set("class-info." + key + ".attribute." + attribute, info.getAttributeLevel(attribute)));
info.getNodeKeys().forEach(node -> config.set("class-info." + key + ".node-levels." + node, info.getNodeLevel(node))); info.getNodeKeys().forEach(node -> config.set("class-info." + key + ".node-levels." + node, info.getNodeLevel(node)));
info.getSkillTreePointsKeys().forEach(skillTreeId -> config.set("class-info." + key + ".skill-tree-points." + skillTreeId, info.getAttributeLevel(skillTreeId))); info.getSkillTreePointsKeys().forEach(skillTreeId -> config.set("class-info." + key + ".skill-tree-points." + skillTreeId, info.getAttributeLevel(skillTreeId)));
info.getBoundSkills().forEach((slot,skill)->config.set("class-info." + key + ".bound-skills."+slot,skill));
} }
file.save(); file.save();