Skip to content

Commit

Permalink
Fix ability data migration causing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Archy-X committed Dec 27, 2023
1 parent 234b0e4 commit 22b5e5c
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ private void applyFormatChanges(ConfigurationNode config) throws SerializationEx
ConfigurationNode skillsNode = config.node("skills");
for (ConfigurationNode oldNode : skillsNode.childrenMap().values()) {
String oldKey = (String) oldNode.key();
skillsNode.node(PLUGIN_NAME + "/" + oldKey).set(oldNode.raw());
skillsNode.removeChild(oldKey);
if (oldKey != null) {
skillsNode.node(PLUGIN_NAME + "/" + oldKey).set(oldNode.raw());
skillsNode.removeChild(oldKey);
}
}
// Add namespaces to stat modifiers
ConfigurationNode statModifiersNode = config.node("stat_modifiers");
Expand All @@ -74,8 +76,10 @@ private void applyFormatChanges(ConfigurationNode config) throws SerializationEx
ConfigurationNode abilityDataNode = config.node("ability_data");
for (ConfigurationNode oldNode : abilityDataNode.childrenMap().values()) {
String oldKey = (String) oldNode.key();
skillsNode.node(PLUGIN_NAME + "/" + oldKey).set(oldNode.raw());
skillsNode.removeChild(oldKey);
if (oldKey != null) {
abilityDataNode.node(PLUGIN_NAME + "/" + oldKey).set(oldNode.raw());
abilityDataNode.removeChild(oldKey);
}
}
}

Expand Down

0 comments on commit 22b5e5c

Please sign in to comment.