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
|
2023-09-25 01:05:05 +02:00
|
|
|
index e0e80f94a005fb21cce76059f66cf4c7ee0f2bfc..c73b57ffd622ccc2e6c570cf874ed118108b899b 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-09-22 18:11:35 +02:00
|
|
|
@@ -401,6 +401,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
|
|
|
|
+ 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
|
2023-09-29 02:28:26 +02:00
|
|
|
index e3e06dc0e8dad4a478f3c8a0178cf6feb64b26cb..38ccf1a75b37e7745426706c2ccbe86506b93f51 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);
|
|
|
|
|
|
|
|
+ // 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();
|
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;
|
|
|
|
+ // Paper
|
|
|
|
}
|
|
|
|
|
2023-09-29 02:28:26 +02:00
|
|
|
@Override
|