From d4b90d3942d7cfb1b9ba1df662701ab249f29922 Mon Sep 17 00:00:00 2001 From: lbenav8095 Date: Mon, 24 Jun 2024 08:29:09 -0600 Subject: [PATCH] Fixes ResourceUtil#writeNewValues --- .../java/us/mytheria/bloblib/utilities/ResourceUtil.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/us/mytheria/bloblib/utilities/ResourceUtil.java b/src/main/java/us/mytheria/bloblib/utilities/ResourceUtil.java index 3b7d6de..6d20781 100644 --- a/src/main/java/us/mytheria/bloblib/utilities/ResourceUtil.java +++ b/src/main/java/us/mytheria/bloblib/utilities/ResourceUtil.java @@ -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 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 {