2022-03-15 19:38:36 +01:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
|
|
|
|
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
|
2024-03-03 23:05:34 +01:00
|
|
|
index af14244caba22e750ee7baba03bb7ce267795b21..fbcf1320ef9c1817b24aa8724cd6cf07319c20b9 100644
|
2022-03-15 19:38:36 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
Updated Upstream (Bukkit/CraftBukkit) (#10034)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
f29cb801 Separate checkstyle-suppressions file is not required
86f99bbe SPIGOT-7540, PR-946: Add ServerTickManager API
d4119585 SPIGOT-6903, PR-945: Add BlockData#getMapColor
b7a2ed41 SPIGOT-7530, PR-947: Add Player#removeResourcePack
9dd56255 SPIGOT-7527, PR-944: Add WindCharge#explode()
994a6163 Attempt upgrade of resolver libraries
CraftBukkit Changes:
b3b43a6ad Add Checkstyle check for unused imports
13fb3358e SPIGOT-7544: Scoreboard#getEntries() doesn't get entries but class names
3dda99c06 SPIGOT-7540, PR-1312: Add ServerTickManager API
2ab4508c0 SPIGOT-6903, PR-1311: Add BlockData#getMapColor
1dbdbbed4 PR-1238: Remove unnecessary sign ticking
659728d2a MC-264285, SPIGOT-7439, PR-1237: Fix unbreakable flint and steel is completely consumed while igniting creeper
e37e29ce0 Increase outdated build delay
c00438b39 SPIGOT-7530, PR-1313: Add Player#removeResourcePack
492dd80ce SPIGOT-7527, PR-1310: Add WindCharge#explode()
e11fbb9d7 Upgrade MySQL driver
9f3a0bd2a Attempt upgrade of resolver libraries
60d16d7ca PR-1306: Centralize Bukkit and Minecraft entity conversion
Spigot Changes:
06d602e7 Rebuild patches
2023-12-17 03:09:28 +01:00
|
|
|
@@ -76,6 +76,13 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
|
2023-09-23 04:06:03 +02:00
|
|
|
return CraftBiome.minecraftHolderToBukkit(this.getHandle().getNoiseBiome(x >> 2, y >> 2, z >> 2));
|
2022-03-15 19:38:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public Biome getComputedBiome(int x, int y, int z) {
|
2023-09-23 04:06:03 +02:00
|
|
|
+ return CraftBiome.minecraftHolderToBukkit(this.getHandle().getBiome(new BlockPos(x, y, z)));
|
2022-03-15 19:38:36 +01:00
|
|
|
+ }
|
|
|
|
+ // 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
|
2023-12-06 17:00:26 +01:00
|
|
|
index 068b3735b6c50a7a2053c7dc39856f728fb7218a..6d10396347b69d9243ab902ecc68ede93fa17b7d 100644
|
2022-03-15 19:38:36 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
2023-12-06 17:00:26 +01:00
|
|
|
@@ -340,6 +340,13 @@ public class CraftBlock implements Block {
|
2022-03-15 19:38:36 +01:00
|
|
|
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
|
2023-12-06 17:00:26 +01:00
|
|
|
index 423a853192c87eb81b79cb6f17866c4665cc1655..ca9bb98ccfc3863c2ba538953470ab9e2b8a2f29 100644
|
2022-03-15 19:38:36 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java
|
2023-06-13 01:51:45 +02:00
|
|
|
@@ -165,6 +165,14 @@ public class CraftLimitedRegion extends CraftRegionAccessor implements LimitedRe
|
2022-03-15 19:38:36 +01:00
|
|
|
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);
|