From 92dc42b3a85c7ddd8aa28b35a228a5ae1c08e475 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Wed, 13 Jul 2011 03:29:43 -0400 Subject: [PATCH] Account for world UID conflicts. By: EvilSeph --- .../src/main/java/org/bukkit/craftbukkit/CraftServer.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 0b27c8ebc5..94120a95c4 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -400,6 +400,13 @@ 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."); + return null; + } + internal.worldMaps = console.worlds.get(0).worldMaps; internal.tracker = new EntityTracker(console, dimension);