Implements a World UID.

By: Rigby <rigby@onarandombox.com>
This commit is contained in:
CraftBukkit/Spigot 2011-07-05 04:48:27 +01:00
parent ae08c5c5ec
commit 860f6ad4b7
2 changed files with 15 additions and 0 deletions

View File

@ -490,6 +490,16 @@ public final class CraftServer implements Server {
return worlds.get(name.toLowerCase()); return worlds.get(name.toLowerCase());
} }
public World getWorld(long uid) {
for (String worldName : worlds.keySet()) {
org.bukkit.World world = worlds.get(worldName);
if (world.getUID() == uid) {
return world;
}
}
return null;
}
public void addWorld(World world) { public void addWorld(World world) {
worlds.put(world.getName().toLowerCase(), world); worlds.put(world.getName().toLowerCase(), world);
} }

View File

@ -395,10 +395,15 @@ public class CraftWorld implements World {
return world.worldData.name; return world.worldData.name;
} }
@Deprecated
public long getId() { public long getId() {
return world.worldData.getSeed(); return world.worldData.getSeed();
} }
public long getUID() {
return world.worldData.getWorldUID();
}
@Override @Override
public String toString() { public String toString() {
return "CraftWorld{name=" + getName() + '}'; return "CraftWorld{name=" + getName() + '}';