mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-13 11:18:23 +01:00
SPIGOT-6428: World.generateTree does not generate bee nests
By: md_5 <git@md-5.net>
This commit is contained in:
parent
17a73066d0
commit
9d052543d0
1 changed files with 1 additions and 8 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue