9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00

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
This commit is contained in:
Dreeam
2025-05-29 17:41:47 +08:00
parent 29dce8ff3c
commit 31c42a45b6

View File

@@ -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;