summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/bukkit
diff options
context:
space:
mode:
authorRigby <rigby@onarandombox.com>2011-07-05 04:48:27 +0100
committerEvilSeph <evilseph@unaligned.org>2011-07-07 14:20:05 -0400
commit9ced39421f6a4009ffbf6eac4167af68fa64f842 (patch)
treed0e13658201d97ed318808ad97a20addee18e6cd /src/main/java/org/bukkit
parent5515ce1ff6e9f64a385025e4edc0da1f1578893f (diff)
downloadcraftbukkit-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.java10
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftWorld.java5
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() + '}';