Skip to content

Commit

Permalink
Fixes ResourceUtil#writeNewValues
Browse files Browse the repository at this point in the history
  • Loading branch information
anjoismysign committed Jun 24, 2024
1 parent 47b0554 commit d4b90d3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/main/java/us/mytheria/bloblib/utilities/ResourceUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,16 @@ public static void writeNewValues(File existingFile, YamlConfiguration updateYam
// if the parent is not a section, it means server admin has changed the file
if (!existingYamlConfig.isConfigurationSection(parent))
return;
existingYamlConfig.set(key, updateYamlConfiguration.get(key));
existingYamlConfig.set(key, updateYamlConfiguration.get(key)); // write
}
if (existingYamlConfig.contains(key)) {
existing.add(key);
return; //if it exists, skip
}
String parent = getParent(key);
List<String> match = existing.stream()
.filter(s -> s.startsWith(parent))
.toList();
if (!match.isEmpty()) return; // if the parent exists, skip
// if the parent is not a section, it means server admin has changed the file
if (!existingYamlConfig.isConfigurationSection(parent))
return;
existingYamlConfig.set(key, updateYamlConfiguration.get(key)); // write
});
try {
Expand Down

0 comments on commit d4b90d3

Please sign in to comment.