Add getWorld method that uses adventure Key (#11199)
This commit is contained in:
@@ -56,8 +56,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
+ // Paper start
|
||||
+ @Override
|
||||
+ public World getWorld(NamespacedKey worldKey) {
|
||||
+ ServerLevel worldServer = console.getLevel(ResourceKey.create(net.minecraft.core.registries.Registries.DIMENSION, CraftNamespacedKey.toMinecraft(worldKey)));
|
||||
+ public World getWorld(net.kyori.adventure.key.Key worldKey) {
|
||||
+ ServerLevel worldServer = console.getLevel(ResourceKey.create(net.minecraft.core.registries.Registries.DIMENSION, io.papermc.paper.adventure.PaperAdventure.asVanilla(worldKey)));
|
||||
+ if (worldServer == null) return null;
|
||||
+ return worldServer.getWorld();
|
||||
+ }
|
||||
|
||||
Reference in New Issue
Block a user