summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEvilSeph <evilseph@gmail.com>2011-07-13 15:35:05 -0400
committerEvilSeph <evilseph@gmail.com>2011-07-13 15:40:31 -0400
commit185d5901465af8e2415183466d7a6017c24550bd (patch)
tree8775e8f85a986954cc851a6445feea36357b65fb /src
parent3d28c67c081e80891d459b102646b956b612a581 (diff)
downloadcraftbukkit-185d5901465af8e2415183466d7a6017c24550bd.tar
craftbukkit-185d5901465af8e2415183466d7a6017c24550bd.tar.gz
craftbukkit-185d5901465af8e2415183466d7a6017c24550bd.tar.lz
craftbukkit-185d5901465af8e2415183466d7a6017c24550bd.tar.xz
craftbukkit-185d5901465af8e2415183466d7a6017c24550bd.zip
Fixed the accounting for world UID conflicts.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftServer.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 94120a95..3c6f19da 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -401,9 +401,7 @@ public final class CraftServer implements Server {
int dimension = 10 + console.worlds.size();
WorldServer internal = new WorldServer(console, new ServerNBTManager(new File("."), name, true), name, dimension, seed, environment, generator);
- if (getWorld(internal.getUUID()) != null) {
- worlds.remove(name);
- System.out.println("World " + name + " is a duplicate of another world and has been prevented from loading. Please delete the uid.dat file from " + name + "'s world directory if you want to be able to load the duplicate world.");
+ if (!(worlds.containsKey(name.toLowerCase()))) {
return null;
}
@@ -512,6 +510,11 @@ public final class CraftServer implements Server {
}
public void addWorld(World world) {
+ // Check if a World already exists with the UID.
+ if (getWorld(world.getUID()) != null) {
+ System.out.println("World " + world.getName() + " is a duplicate of another world and has been prevented from loading. Please delete the uid.dat file from " + world.getName() + "'s world directory if you want to be able to load the duplicate world.");
+ return;
+ }
worlds.put(world.getName().toLowerCase(), world);
}