diff options
author | Rigby <rigby@onarandombox.com> | 2011-07-05 04:48:27 +0100 |
---|---|---|
committer | EvilSeph <evilseph@unaligned.org> | 2011-07-07 14:20:05 -0400 |
commit | 9ced39421f6a4009ffbf6eac4167af68fa64f842 (patch) | |
tree | d0e13658201d97ed318808ad97a20addee18e6cd /src/main/java/org/bukkit | |
parent | 5515ce1ff6e9f64a385025e4edc0da1f1578893f (diff) | |
download | craftbukkit-9ced39421f6a4009ffbf6eac4167af68fa64f842.tar craftbukkit-9ced39421f6a4009ffbf6eac4167af68fa64f842.tar.gz craftbukkit-9ced39421f6a4009ffbf6eac4167af68fa64f842.tar.lz craftbukkit-9ced39421f6a4009ffbf6eac4167af68fa64f842.tar.xz craftbukkit-9ced39421f6a4009ffbf6eac4167af68fa64f842.zip |
Implements a World UID.
Diffstat (limited to 'src/main/java/org/bukkit')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftServer.java | 10 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 5 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 3735635f..915186e8 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -490,6 +490,16 @@ public final class CraftServer implements Server { 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) { worlds.put(world.getName().toLowerCase(), world); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index b09e357e..fac24e3e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -395,10 +395,15 @@ public class CraftWorld implements World { return world.worldData.name; } + @Deprecated public long getId() { return world.worldData.getSeed(); } + public long getUID() { + return world.worldData.getWorldUID(); + } + @Override public String toString() { return "CraftWorld{name=" + getName() + '}'; |