From 9d052543d0e6a8da302f95caee09533551f2f93b Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sun, 18 Apr 2021 17:42:35 +1000 Subject: [PATCH] SPIGOT-6428: World.generateTree does not generate bee nests By: md_5 --- .../src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 0dd4bb8223..065c3a6ea9 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -751,18 +751,11 @@ public class CraftWorld implements World { @Override public boolean generateTree(Location loc, TreeType type, BlockChangeDelegate delegate) { world.captureTreeGeneration = true; - world.captureBlockStates = true; boolean grownTree = generateTree(loc, type); - world.captureBlockStates = false; world.captureTreeGeneration = false; if (grownTree) { // Copy block data to delegate for (BlockState blockstate : world.capturedBlockStates.values()) { - BlockPosition position = ((CraftBlockState) blockstate).getPosition(); - net.minecraft.world.level.block.state.IBlockData oldBlock = world.getType(position); - int flag = ((CraftBlockState) blockstate).getFlag(); - delegate.setBlockData(blockstate.getX(), blockstate.getY(), blockstate.getZ(), blockstate.getBlockData()); - net.minecraft.world.level.block.state.IBlockData newBlock = world.getType(position); - world.notifyAndUpdatePhysics(position, null, oldBlock, newBlock, newBlock, flag, 512); + blockstate.update(true); } world.capturedBlockStates.clear(); return true;