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 @Override
public boolean generateTree(Location loc, TreeType type, BlockChangeDelegate delegate) { public boolean generateTree(Location loc, TreeType type, BlockChangeDelegate delegate) {
world.captureTreeGeneration = true; world.captureTreeGeneration = true;
world.captureBlockStates = true;
boolean grownTree = generateTree(loc, type); boolean grownTree = generateTree(loc, type);
world.captureBlockStates = false;
world.captureTreeGeneration = false; world.captureTreeGeneration = false;
if (grownTree) { // Copy block data to delegate if (grownTree) { // Copy block data to delegate
for (BlockState blockstate : world.capturedBlockStates.values()) { for (BlockState blockstate : world.capturedBlockStates.values()) {
BlockPosition position = ((CraftBlockState) blockstate).getPosition(); blockstate.update(true);
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);
} }
world.capturedBlockStates.clear(); world.capturedBlockStates.clear();
return true; return true;