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 3735635f39..915186e848 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/paper-server/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/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index b09e357e4c..fac24e3eec 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/paper-server/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() + '}';