2023-03-26 21:07:32 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
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
2024-01-18 22:00:40 +01:00
index a246e12438402dd692a5171f1e779f5f77d2f212..df38d95c38831c884cbfb4a15b8ba682f0b1ab51 100644
2023-03-26 21:07:32 +02:00
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
2023-12-06 17:21:56 +01:00
@@ -422,6 +422,7 @@ public final class ItemStack {
2023-03-26 21:07:32 +02:00
}
for (CraftBlockState blockstate : blocks) {
world.setBlock(blockstate.getPosition(),blockstate.getHandle(), blockstate.getFlag()); // SPIGOT-7248 - manual update to avoid physics where appropriate
2024-01-15 12:38:39 +01:00
+ if (blockstate instanceof org.bukkit.craftbukkit.block.CapturedBlockState capturedBlockState) capturedBlockState.checkTreeBlockHack(); // Paper - Fix beehives generating from using bonemeal
2023-03-26 21:07:32 +02:00
}
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
2024-01-15 12:38:39 +01:00
index 2aab5ba9e90f09e6d679ee0d0d5d5e52c44b677f..c17c8b2bff32bfd101675d73f8ab81b35a9e1c15 100644
2023-03-26 21:07:32 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java
2023-09-29 02:28:26 +02:00
@@ -31,6 +31,12 @@ public final class CapturedBlockState extends CraftBlockState {
2023-03-26 21:07:32 +02:00
public boolean update(boolean force, boolean applyPhysics) {
boolean result = super.update(force, applyPhysics);
2024-01-15 12:38:39 +01:00
+ // Paper start - Fix beehives generating from using bonemeal
2023-03-26 21:07:32 +02:00
+ this.checkTreeBlockHack();
+ return result;
+ }
+ public void checkTreeBlockHack() {
2024-01-15 12:38:39 +01:00
+ // Paper end - Fix beehives generating from using bonemeal
2023-03-26 21:07:32 +02:00
// SPIGOT-5537: Horrible hack to manually add bees given World.captureTreeGeneration does not support tiles
2023-10-27 01:34:58 +02:00
if (this.treeBlock && this.getType() == Material.BEE_NEST) {
2023-03-26 21:07:32 +02:00
WorldGenLevel generatoraccessseed = this.world.getHandle();
2023-09-29 02:28:26 +02:00
@@ -53,7 +59,7 @@ public final class CapturedBlockState extends CraftBlockState {
2023-03-26 21:07:32 +02:00
// End copied block
}
- return result;
2024-01-15 12:38:39 +01:00
+ // Paper - Fix beehives generating from using bonemeal
2023-03-26 21:07:32 +02:00
}
2023-09-29 02:28:26 +02:00
@Override