SPIGOT-5537: Bee nests generated by growing trees near flower have no bees

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2020-01-28 09:48:28 +11:00
parent 37d58b321b
commit e0ee6f0a50
7 changed files with 99 additions and 72 deletions

View File

@@ -1,12 +1,10 @@
--- a/net/minecraft/server/BlockSapling.java
+++ b/net/minecraft/server/BlockSapling.java
@@ -2,11 +2,21 @@
@@ -2,11 +2,19 @@
import java.util.Random;
+// CraftBukkit start
+import java.util.List;
+
+import org.bukkit.Location;
+import org.bukkit.TreeType;
+import org.bukkit.block.BlockState;
@@ -22,7 +20,7 @@
protected BlockSapling(WorldGenTreeProvider worldgentreeprovider, Block.Info block_info) {
super(block_info);
@@ -23,7 +33,30 @@
@@ -23,7 +31,30 @@
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
super.tick(iblockdata, worldserver, blockposition, random);
if (worldserver.getLightLevel(blockposition.up()) >= 9 && random.nextInt(7) == 0) {
@@ -36,7 +34,7 @@
+ TreeType treeType = BlockSapling.treeType;
+ BlockSapling.treeType = null;
+ Location location = new Location(worldserver.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ());
+ List<BlockState> blocks = (List<BlockState>) worldserver.capturedBlockStates.clone();
+ java.util.List<BlockState> blocks = new java.util.ArrayList<>(worldserver.capturedBlockStates.values());
+ worldserver.capturedBlockStates.clear();
+ StructureGrowEvent event = null;
+ if (treeType != null) {