aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0949-Fix-beehives-generating-from-using-bonemeal.patch
diff options
context:
space:
mode:
authorSpottedleaf <[email protected]>2023-06-08 16:21:20 -0700
committerSpottedleaf <[email protected]>2023-06-08 16:21:20 -0700
commit902691b636614df08ba407823109b44be47f2277 (patch)
treed81004f9582a0eef33672278697d7fad798e84b2 /patches/server/0949-Fix-beehives-generating-from-using-bonemeal.patch
parent619d7c93d80c4fecf7b3db9f2750e44a0ce611d2 (diff)
downloadPaper-902691b636614df08ba407823109b44be47f2277.tar.gz
Paper-902691b636614df08ba407823109b44be47f2277.zip
Apply last patch
Diffstat (limited to 'patches/server/0949-Fix-beehives-generating-from-using-bonemeal.patch')
-rw-r--r--patches/server/0949-Fix-beehives-generating-from-using-bonemeal.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/patches/server/0949-Fix-beehives-generating-from-using-bonemeal.patch b/patches/server/0949-Fix-beehives-generating-from-using-bonemeal.patch
new file mode 100644
index 0000000000..48fda8c1b9
--- /dev/null
+++ b/patches/server/0949-Fix-beehives-generating-from-using-bonemeal.patch
@@ -0,0 +1,44 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jake Potrebic <[email protected]>
+Date: Sun, 26 Mar 2023 18:07:56 -0700
+Subject: [PATCH] Fix beehives generating from using bonemeal
+
+
+diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
+index deb1b4c4216f76c4b44a31c337d43baae8039640..da4e0712bea0c7aad9fe905b805b9fa11580f59f 100644
+--- a/src/main/java/net/minecraft/world/item/ItemStack.java
++++ b/src/main/java/net/minecraft/world/item/ItemStack.java
+@@ -392,6 +392,7 @@ public final class ItemStack {
+ }
+ for (CraftBlockState blockstate : blocks) {
+ world.setBlock(blockstate.getPosition(),blockstate.getHandle(), blockstate.getFlag()); // SPIGOT-7248 - manual update to avoid physics where appropriate
++ if (blockstate instanceof org.bukkit.craftbukkit.block.CapturedBlockState capturedBlockState) capturedBlockState.checkTreeBlockHack(); // Paper
+ }
+ entityhuman.awardStat(Stats.ITEM_USED.get(item)); // SPIGOT-7236 - award stat
+ }
+diff --git a/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java
+index fb6454cc64ebc549f61ad7d51efb16ef15f8384d..a3d5e319473e2f6316b3ef8edf719296e02d85a1 100644
+--- a/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java
++++ b/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java
+@@ -25,6 +25,12 @@ public final class CapturedBlockState extends CraftBlockState {
+ public boolean update(boolean force, boolean applyPhysics) {
+ boolean result = super.update(force, applyPhysics);
+
++ // Paper start
++ this.checkTreeBlockHack();
++ return result;
++ }
++ public void checkTreeBlockHack() {
++ // Paper end
+ // SPIGOT-5537: Horrible hack to manually add bees given World.captureTreeGeneration does not support tiles
+ if (this.treeBlock && getType() == Material.BEE_NEST) {
+ WorldGenLevel generatoraccessseed = this.world.getHandle();
+@@ -47,7 +53,7 @@ public final class CapturedBlockState extends CraftBlockState {
+ // End copied block
+ }
+
+- return result;
++ // Paper
+ }
+
+ public static CapturedBlockState getBlockState(Level world, BlockPos pos, int flag) {