Temp fix to fix tests

This commit is contained in:
Ben Woo 2023-08-31 14:03:03 +08:00
parent cbf44cb918
commit 4ff1663353
No known key found for this signature in database
GPG Key ID: FB2A3645536E12C8

View File

@ -109,9 +109,9 @@ public class SimpleMVWorldManager implements MVWorldManager {
@Override
public void getDefaultWorldGenerators() {
this.defaultGens = new HashMap<>();
File[] files = server.getWorldContainer().listFiles((file, s) -> s.equalsIgnoreCase("bukkit.yml"));
if (files != null && files.length == 1) {
FileConfiguration bukkitConfig = YamlConfiguration.loadConfiguration(files[0]);
File file = new File("bukkit.yml");
if (file.isFile()) {
FileConfiguration bukkitConfig = YamlConfiguration.loadConfiguration(file);
if (bukkitConfig.isConfigurationSection("worlds")) {
Set<String> keys = bukkitConfig.getConfigurationSection("worlds").getKeys(false);
for (String key : keys) {