Expand world key API

This commit is contained in:
Jake Potrebic
2021-01-06 00:34:10 -08:00
parent bcd78c9bf2
commit 07c1829d7f
5 changed files with 134 additions and 5 deletions

View File

@@ -865,6 +865,29 @@ public final class Bukkit {
public static World getWorld(@NotNull UUID uid) {
return server.getWorld(uid);
}
// Paper start
/**
* Gets the world from the given NamespacedKey
*
* @param worldKey the NamespacedKey of the world to retrieve
* @return a world with the given NamespacedKey, or null if none exists
*/
@Nullable
public static World getWorld(@NotNull NamespacedKey worldKey) {
return server.getWorld(worldKey);
}
/**
* Gets the world from the given Key
*
* @param worldKey the Key of the world to retrieve
* @return a world with the given Key, or null if none exists
*/
@Nullable
public static World getWorld(@NotNull net.kyori.adventure.key.Key worldKey) {
return server.getWorld(worldKey);
}
// Paper end
/**
* Create a new virtual {@link WorldBorder}.