From b8a0891c4c4e64e5f750b7e9c4ab7d85285a522a Mon Sep 17 00:00:00 2001 From: "main()" Date: Mon, 6 Aug 2012 12:06:50 +0200 Subject: [PATCH] Fixed again... --- .../MultiverseCore/utils/WorldManager.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/WorldManager.java b/src/main/java/com/onarandombox/MultiverseCore/utils/WorldManager.java index 1d6b6185..ff9d1787 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/WorldManager.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/WorldManager.java @@ -220,7 +220,7 @@ public class WorldManager implements MVWorldManager { } this.plugin.log(Level.INFO, builder.toString()); - if (!doLoad(c)) { + if (!doLoad(c, true)) { this.plugin.log(Level.SEVERE, "Failed to Create/Load the world '" + name + "'"); return false; } @@ -359,6 +359,10 @@ public class WorldManager implements MVWorldManager { } private boolean doLoad(String name) { + return doLoad(name, false); + } + + private boolean doLoad(String name, boolean ignoreExists) { if (!worldsFromTheConfig.containsKey(name)) throw new IllegalArgumentException("That world doesn't exist!"); @@ -369,10 +373,10 @@ public class WorldManager implements MVWorldManager { if ((world.getGenerator() != null) && (!world.getGenerator().equals("null"))) creator.generator(world.getGenerator()); - return doLoad(creator); + return doLoad(creator, ignoreExists); } - private boolean doLoad(WorldCreator creator) { + private boolean doLoad(WorldCreator creator, boolean ignoreExists) { String worldName = creator.name(); if (!worldsFromTheConfig.containsKey(worldName)) throw new IllegalArgumentException("That world doesn't exist!"); @@ -381,7 +385,7 @@ public class WorldManager implements MVWorldManager { throw new IllegalArgumentException("That world is already loaded!"); } - if (!new File(this.plugin.getServer().getWorldContainer(), worldName).exists()) { + if (!ignoreExists && !new File(this.plugin.getServer().getWorldContainer(), worldName).exists()) { this.plugin.log(Level.WARNING, "WorldManager: Can't load this world because the folder was deleted/moved: " + worldName); this.plugin.log(Level.WARNING, "Use '/mv remove' to remove it from the config!"); return false;