diff --git a/paper-api/src/main/java/org/bukkit/Server.java b/paper-api/src/main/java/org/bukkit/Server.java index 124e5d084d..b38774743b 100644 --- a/paper-api/src/main/java/org/bukkit/Server.java +++ b/paper-api/src/main/java/org/bukkit/Server.java @@ -217,6 +217,14 @@ public interface Server { */ public World getWorld(String name); + /** + * Gets the world from the given Unique ID + * + * @param uid Unique ID of the world to retrieve. + * @return World with the given Unique ID, or null if none exists. + */ + public World getWorld(long uid); + /** * Reloads the server, refreshing settings and plugin information */ diff --git a/paper-api/src/main/java/org/bukkit/World.java b/paper-api/src/main/java/org/bukkit/World.java index 1970086e02..28fb521986 100644 --- a/paper-api/src/main/java/org/bukkit/World.java +++ b/paper-api/src/main/java/org/bukkit/World.java @@ -363,14 +363,23 @@ public interface World { */ public String getName(); + /** + * Gets the Unique ID of this world + * + * @return Unique ID of this world. + */ + public long getUID(); + /** * Gets a semi-unique identifier for this world. * * While it is highly unlikely that this may be shared with another World, * it is not guaranteed to be unique * + * @deprecated Replaced with {@link #getUID()} * @return Id of this world */ + @Deprecated public long getId(); /** @@ -620,7 +629,7 @@ public interface World { /** * Sets the spawn flags for this. - * + * * @param allowMonsters - if true, monsters are allowed to spawn in this world. * @param allowAnimals - if true, animals are allowed to spawn in this world. */