13
0
geforkt von Mirrors/Paper

SPIGOT-6428: World.generateTree does not generate bee nests

By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2021-04-18 17:42:35 +10:00
Ursprung 17a73066d0
Commit 9d052543d0

Datei anzeigen

@ -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;