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

@@ -726,6 +726,28 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@Nullable
public World getWorld(@NotNull UUID 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
default World getWorld(@NotNull NamespacedKey worldKey) {
return getWorld((net.kyori.adventure.key.Key) 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
World getWorld(@NotNull net.kyori.adventure.key.Key worldKey);
// Paper end
/**
* Create a new virtual {@link WorldBorder}.
* <p>