From 31c42a45b6f86b643d2eae057f98fbc0ca1e17c3 Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Thu, 29 May 2025 17:41:47 +0800 Subject: [PATCH] Use correct way to resolve all world config path Fixes https://github.com/Winds-Studio/Leaf/issues/342 supersedes https://github.com/Winds-Studio/Leaf/pull/344 --- .../src/main/java/org/dreeam/leaf/config/LeafConfig.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/leaf-server/src/main/java/org/dreeam/leaf/config/LeafConfig.java b/leaf-server/src/main/java/org/dreeam/leaf/config/LeafConfig.java index e40a1c50..ad14e420 100644 --- a/leaf-server/src/main/java/org/dreeam/leaf/config/LeafConfig.java +++ b/leaf-server/src/main/java/org/dreeam/leaf/config/LeafConfig.java @@ -227,8 +227,12 @@ public class LeafConfig { extraConfigs.addAll(Arrays.asList(existing.split(","))); } + // Use same way in spark's BukkitServerConfigProvider#getNestedFiles to get all world configs + // It may spam in the spark profiler, but it's ok, since spark uses YamlConfigParser.INSTANCE to + // get configs defined in extra config flag instead of using SplitYamlConfigParser.INSTANCE for (World world : Bukkit.getWorlds()) { - extraConfigs.add(world.getWorldFolder().getName() + "/gale-world.yml"); // Gale world config + Path galeWorldFolder = world.getWorldFolder().toPath().resolve("gale-world.yml"); + extraConfigs.add(galeWorldFolder.toString().replace("\\", "/").replace("./", "")); // Gale world config } return extraConfigs;