2022-08-14 18:23:57 +02:00
|
|
|
From 0000000000000000000000000000000000000000 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>
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
2024-10-31 23:44:34 +01:00
|
|
|
index 2a3dc48aa50b41ede0e1a0e280314624961967f2..d4d5d40ba3bcf715e52aeb72ec4d14718c793e7c 100644
|
2022-08-14 18:23:57 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
2024-10-31 23:44:34 +01:00
|
|
|
@@ -598,6 +598,16 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
2024-10-27 18:11:15 +01:00
|
|
|
var supplier = net.minecraft.world.entity.ai.attributes.DefaultAttributes.getSupplier((net.minecraft.world.entity.EntityType<? extends net.minecraft.world.entity.LivingEntity>) net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.getValue(CraftNamespacedKey.toMinecraft(bukkitEntityKey)));
|
|
|
|
return new io.papermc.paper.attribute.UnmodifiableAttributeMap(supplier);
|
2022-08-14 18:23:57 +02:00
|
|
|
}
|
2024-10-27 18:11:15 +01:00
|
|
|
+
|
2022-08-14 18:23:57 +02:00
|
|
|
+ @Override
|
|
|
|
+ public org.bukkit.NamespacedKey getBiomeKey(org.bukkit.RegionAccessor accessor, int x, int y, int z) {
|
2024-10-31 23:44:34 +01:00
|
|
|
+ return accessor.getBiome(x, y, z).getKey();
|
2022-08-14 18:23:57 +02:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void setBiomeKey(org.bukkit.RegionAccessor accessor, int x, int y, int z, org.bukkit.NamespacedKey biomeKey) {
|
2024-10-31 23:44:34 +01:00
|
|
|
+ accessor.setBiome(x, y, z, org.bukkit.Registry.BIOME.getOrThrow(biomeKey));
|
2022-08-14 18:23:57 +02:00
|
|
|
+ }
|
2024-10-27 18:11:15 +01:00
|
|
|
// Paper end
|
|
|
|
|
|
|
|
/**
|