diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/data/mysql/MySQLPlayerDataManager.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/data/mysql/MySQLPlayerDataManager.java index 73802d23..3fa1483a 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/data/mysql/MySQLPlayerDataManager.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/data/mysql/MySQLPlayerDataManager.java @@ -231,6 +231,9 @@ public class MySQLPlayerDataManager extends PlayerDataManager { classinfo.addProperty("skill-points", info.getSkillPoints()); classinfo.addProperty("attribute-points", info.getAttributePoints()); classinfo.addProperty("attribute-realloc-points", info.getAttributeReallocationPoints()); + classinfo.addProperty("skill-reallocation-points",info.getSkillReallocationPoints()); + classinfo.addProperty("skill-tree-reallocation-points",info.getSkillTreeReallocationPoints()); + JsonObject skillinfo = new JsonObject(); for (String skill : info.getSkillKeys()) skillinfo.addProperty(skill, info.getSkillLevel(skill)); @@ -240,6 +243,16 @@ public class MySQLPlayerDataManager extends PlayerDataManager { attributeinfo.addProperty(attribute, info.getAttributeLevel(attribute)); classinfo.add("attribute", attributeinfo); + JsonObject nodeLevelsInfo = new JsonObject(); + for (SkillTreeNode node : info.getNodeKeys()) + attributeinfo.addProperty(node.getFullId(), info.getNodeLevel(node)); + classinfo.add("node-levels", nodeLevelsInfo); + + JsonObject skillTreePointsInfo = new JsonObject(); + for (String skillTreeId : info.getSkillTreePointsKeys()) + attributeinfo.addProperty(skillTreeId, info.getSkillTreePoints(skillTreeId)); + classinfo.add("skill-tree-points", skillTreePointsInfo); + json.add(c, classinfo); } diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/data/yaml/YAMLPlayerDataManager.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/data/yaml/YAMLPlayerDataManager.java index 86bb8c6c..145a02e4 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/data/yaml/YAMLPlayerDataManager.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/data/yaml/YAMLPlayerDataManager.java @@ -175,11 +175,15 @@ public class YAMLPlayerDataManager extends PlayerDataManager { config.set("class-info." + key + ".skill-points", info.getSkillPoints()); config.set("class-info." + key + ".attribute-points", info.getAttributePoints()); config.set("class-info." + key + ".attribute-realloc-points", info.getAttributeReallocationPoints()); + config.set("class-info." + key + ".skill-tree-reallocation-points", info.getSkillTreeReallocationPoints()); + config.set("class-info." + key + ".skill-reallocation-points", info.getSkillReallocationPoints()); info.getSkillKeys().forEach(skill -> config.set("class-info." + key + ".skill." + skill, info.getSkillLevel(skill))); - 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.getFullId(), info.getNodeLevel(node))); + info.getSkillTreePointsKeys().forEach(skillTreeId -> config.set("class-info." + key + ".skill-tree-points." + skillTreeId, info.getAttributeLevel(skillTreeId))); } + file.save(); }