aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0681-Implement-getComputedBiome-API.patch
diff options
context:
space:
mode:
authorSpottedleaf <[email protected]>2024-07-17 10:24:53 -0700
committerSpottedleaf <[email protected]>2024-07-17 10:28:32 -0700
commit00b949f1bbbf444e2b5e7b8de7c9b14fbd2133c6 (patch)
tree82639515bc5e9ae00c1e639e72137ed51e1ac688 /patches/server/0681-Implement-getComputedBiome-API.patch
parent967f98aa81da851740aeb429778e46159fd188df (diff)
downloadPaper-00b949f1bbbf444e2b5e7b8de7c9b14fbd2133c6.tar.gz
Paper-00b949f1bbbf444e2b5e7b8de7c9b14fbd2133c6.zip
Remove Moonrise utils to MCUtils, remove duplicated/unused utils
Diffstat (limited to 'patches/server/0681-Implement-getComputedBiome-API.patch')
-rw-r--r--patches/server/0681-Implement-getComputedBiome-API.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/patches/server/0681-Implement-getComputedBiome-API.patch b/patches/server/0681-Implement-getComputedBiome-API.patch
new file mode 100644
index 0000000000..41624673a7
--- /dev/null
+++ b/patches/server/0681-Implement-getComputedBiome-API.patch
@@ -0,0 +1,61 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jason Penilla <[email protected]>
+Date: Mon, 14 Mar 2022 22:46:05 -0700
+Subject: [PATCH] Implement getComputedBiome API
+
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
+index 5d137f8c42356359701e1bea7525f82c018b502c..f6dd8665b9f6e2a8ff396deba8a021e695bedf7e 100644
+--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
++++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
+@@ -77,6 +77,13 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
+ return CraftBiome.minecraftHolderToBukkit(this.getHandle().getNoiseBiome(x >> 2, y >> 2, z >> 2));
+ }
+
++ // Paper start
++ @Override
++ public Biome getComputedBiome(int x, int y, int z) {
++ return CraftBiome.minecraftHolderToBukkit(this.getHandle().getBiome(new BlockPos(x, y, z)));
++ }
++ // Paper end
++
+ @Override
+ public void setBiome(Location location, Biome biome) {
+ this.setBiome(location.getBlockX(), location.getBlockY(), location.getBlockZ(), biome);
+diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+index 068b3735b6c50a7a2053c7dc39856f728fb7218a..6d10396347b69d9243ab902ecc68ede93fa17b7d 100644
+--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+@@ -340,6 +340,13 @@ public class CraftBlock implements Block {
+ return this.getWorld().getBiome(this.getX(), this.getY(), this.getZ());
+ }
+
++ // Paper start
++ @Override
++ public Biome getComputedBiome() {
++ return this.getWorld().getComputedBiome(this.getX(), this.getY(), this.getZ());
++ }
++ // Paper end
++
+ @Override
+ public void setBiome(Biome bio) {
+ this.getWorld().setBiome(this.getX(), this.getY(), this.getZ(), bio);
+diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java b/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java
+index 7d6ee60b1d3e023e1eabc59eb591c3ae3d8ac043..eaa9ba70b0b80d86eb376a0641420093a7c9dfdb 100644
+--- a/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java
++++ b/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java
+@@ -165,6 +165,14 @@ public class CraftLimitedRegion extends CraftRegionAccessor implements LimitedRe
+ return super.getBiome(x, y, z);
+ }
+
++ // Paper start
++ @Override
++ public Biome getComputedBiome(int x, int y, int z) {
++ Preconditions.checkArgument(this.isInRegion(x, y, z), "Coordinates %s, %s, %s are not in the region", x, y, z);
++ return super.getComputedBiome(x, y, z);
++ }
++ // Paper end
++
+ @Override
+ public void setBiome(int x, int y, int z, Holder<net.minecraft.world.level.biome.Biome> biomeBase) {
+ Preconditions.checkArgument(this.isInRegion(x, y, z), "Coordinates %s, %s, %s are not in the region", x, y, z);