Add getWorld method that uses adventure Key (#11199)
This commit is contained in:
@@ -23,6 +23,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ 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
|
||||
|
||||
/**
|
||||
@@ -71,7 +82,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ * @return a world with the given NamespacedKey, or null if none exists
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public World getWorld(@NotNull NamespacedKey worldKey);
|
||||
+ 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
|
||||
+
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user