Skip to content

Commit

Permalink
Fixed replace map config screwing up when no entries are present
Browse files Browse the repository at this point in the history
  • Loading branch information
ArkoSammy12 committed Oct 11, 2023
1 parent 433c8d6 commit a996694
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ public static void saveToFileWithDefaultValues(CommentedFileConfig fileConfig){
}

public static void saveReplaceMapToFile(CommentedFileConfig fileConfig){
for(Map.Entry<String, String> entry : replaceMap.entrySet()){
fileConfig.set(TABLE_NAME + "." + entry.getKey(), entry.getValue());
if(!replaceMap.isEmpty()) {
for (Map.Entry<String, String> entry : replaceMap.entrySet()) {
fileConfig.set(TABLE_NAME + "." + entry.getKey(), entry.getValue());
}
} else {
fileConfig.set(TABLE_NAME + "." + "minecraft:placeholder_key", "minecraft:placeholder_value");
}
fileConfig.setComment(TABLE_NAME, TABLE_COMMENT);
}
Expand Down

0 comments on commit a996694

Please sign in to comment.