diff --git a/bukkit/src/main/java/com/griefdefender/GriefDefenderPlugin.java b/bukkit/src/main/java/com/griefdefender/GriefDefenderPlugin.java index 39643d8..caf5700 100644 --- a/bukkit/src/main/java/com/griefdefender/GriefDefenderPlugin.java +++ b/bukkit/src/main/java/com/griefdefender/GriefDefenderPlugin.java @@ -1080,19 +1080,19 @@ public void loadConfig() { if (this.dataStore != null) { for (World world : Bukkit.getServer().getWorlds()) { final String dimType = world.getEnvironment().name().toLowerCase(); + final String worldName = world.getName().toLowerCase(); final Path dimPath = rootConfigPath.resolve(dimType); - if (Files.notExists(dimPath.resolve(world.getName()))) { + if (Files.notExists(dimPath.resolve(worldName))) { try { - Files.createDirectories(rootConfigPath.resolve(dimType).resolve(world.getName())); + Files.createDirectories(rootConfigPath.resolve(dimType).resolve(worldName)); } catch (IOException e) { e.printStackTrace(); } } - + GriefDefenderConfig dimConfig = new GriefDefenderConfig<>(ConfigBase.class, dimPath.resolve("dimension.conf"), BaseStorage.globalConfig); - GriefDefenderConfig worldConfig = new GriefDefenderConfig<>(ConfigBase.class, dimPath.resolve(world.getName()).resolve("world.conf"), dimConfig); - BaseStorage.dimensionConfigMap.put(world.getUID(), dimConfig); + GriefDefenderConfig worldConfig = new GriefDefenderConfig<>(ConfigBase.class, dimPath.resolve(worldName).resolve("world.conf"), dimConfig); BaseStorage.worldConfigMap.put(world.getUID(), worldConfig); // refresh player data @@ -1109,7 +1109,7 @@ public void loadConfig() { GriefDefenderPlugin.getGlobalConfig().save(); } if (this.worldEditProvider != null) { - this.getLogger().info("Loading schematics for world " + world.getName() + "..."); + this.getLogger().info("Loading schematics for world " + worldName + "..."); this.worldEditProvider.loadSchematics(world); } } diff --git a/sponge/src/main/java/com/griefdefender/GriefDefenderPlugin.java b/sponge/src/main/java/com/griefdefender/GriefDefenderPlugin.java index 7955680..98b71fd 100644 --- a/sponge/src/main/java/com/griefdefender/GriefDefenderPlugin.java +++ b/sponge/src/main/java/com/griefdefender/GriefDefenderPlugin.java @@ -1145,20 +1145,20 @@ public void loadConfig() { for (World world : Sponge.getGame().getServer().getWorlds()) { DimensionType dimType = world.getProperties().getDimensionType(); final String[] parts = dimType.getId().split(":"); + final String worldName = world.getProperties().getWorldName(); final Path dimPath = rootConfigPath.resolve(parts[0]).resolve(dimType.getName()); - if (!Files.exists(dimPath.resolve(world.getProperties().getWorldName()))) { + if (!Files.exists(dimPath.resolve(worldName))) { try { - Files.createDirectories(rootConfigPath.resolve(dimType.getId()).resolve(world.getName())); + Files.createDirectories(rootConfigPath.resolve(dimType.getId()).resolve(worldName)); } catch (IOException e) { e.printStackTrace(); } } - + GriefDefenderConfig dimConfig = new GriefDefenderConfig<>(ConfigBase.class, dimPath.resolve("dimension.conf"), BaseStorage.globalConfig); - GriefDefenderConfig worldConfig = new GriefDefenderConfig<>(ConfigBase.class, dimPath.resolve(world.getProperties().getWorldName()).resolve("world.conf"), dimConfig); - - BaseStorage.dimensionConfigMap.put(world.getProperties().getUniqueId(), dimConfig); - BaseStorage.worldConfigMap.put(world.getProperties().getUniqueId(), worldConfig); + BaseStorage.dimensionConfigMap.put(world.getUniqueId(), dimConfig); + GriefDefenderConfig worldConfig = new GriefDefenderConfig<>(ConfigBase.class, dimPath.resolve(worldName).resolve("world.conf"), dimConfig); + BaseStorage.worldConfigMap.put(world.getUniqueId(), worldConfig); // refresh player data final GDClaimManager claimManager = GriefDefenderPlugin.getInstance().dataStore.getClaimWorldManager(world.getUniqueId()); @@ -1174,10 +1174,10 @@ public void loadConfig() { GriefDefenderPlugin.getGlobalConfig().save(); } if (this.worldEditProvider != null && GriefDefenderPlugin.getGlobalConfig().getConfig().claim.useWorldEditSchematics) { - this.getLogger().info("Loading schematics for world " + world.getName() + "..."); + this.getLogger().info("Loading schematics for world " + worldName + "..."); this.worldEditProvider.loadSchematics(world); } else { - this.getLogger().info("Loading sponge schematics for world " + world.getName() + "..."); + this.getLogger().info("Loading sponge schematics for world " + worldName + "..."); ((FileStorage) this.dataStore).loadSpongeSchematics(world); } }