From ebdde69c39f2981106f9941f518e201f925a1646 Mon Sep 17 00:00:00 2001 From: Josh Roy <10731363+JRoy@users.noreply.github.com> Date: Sun, 14 Aug 2022 12:23:11 -0400 Subject: [PATCH] Add NamespacedKey biome methods Co-authored-by: Thonk <30448663+ExcessiveAmountsOfZombies@users.noreply.github.com> --- .../org/bukkit/craftbukkit/util/CraftMagicNumbers.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/paper-server/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java index d7698f8ae5..088ff124ca 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -598,6 +598,16 @@ public final class CraftMagicNumbers implements UnsafeValues { var supplier = net.minecraft.world.entity.ai.attributes.DefaultAttributes.getSupplier((net.minecraft.world.entity.EntityType) net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.getValue(CraftNamespacedKey.toMinecraft(bukkitEntityKey))); return new io.papermc.paper.attribute.UnmodifiableAttributeMap(supplier); } + + @Override + public org.bukkit.NamespacedKey getBiomeKey(org.bukkit.RegionAccessor accessor, int x, int y, int z) { + return accessor.getBiome(x, y, z).getKey(); + } + + @Override + public void setBiomeKey(org.bukkit.RegionAccessor accessor, int x, int y, int z, org.bukkit.NamespacedKey biomeKey) { + accessor.setBiome(x, y, z, org.bukkit.Registry.BIOME.getOrThrow(biomeKey)); + } // Paper end /**