ShapeUpdates 5.46.0
Shape updates after structure placement, for the blocks whose state depends on their neighbours: fences, walls, iron bars / glass panes, stairs and wall banners (vanilla's BlockState.updateShape() of FenceBlock, WallBlock, IronBarsBlock, StairBlock and WallBannerBlock, and Block.updateFromNeighbourShapes()). Vanilla runs them:
- for every block of a template placed without a known shape (StructureTemplate.placeInWorld(): all templates except jigsaw elements), after updateShapeAtEdge() on the faces of the placed blocks;
- for the fences, iron bars, torches and ladders placed by code-built pieces (StructurePiece.SHAPE_CHECK_BLOCKS, post-processed when the chunk becomes full). Other blocks (torches, ladders, chests, redstone...) are left as placed. "Sturdy face" uses the collision shape.
Methods
__construct()
public function __construct(\pocketmine\world\generator\vanilla\feature\block\JavaBlocks $blocks)afterTemplatePlacement()
public function afterTemplatePlacement(\pocketmine\world\generator\vanilla\feature\FeatureLevel $level, array $placed) : voidStructureTemplate.updateShapeAtEdge() + the updateFromNeighbourShapes() pass of placeInWorld() for the blocks a template placed (positions in placement order).
isShapeDependent()
public function isShapeDependent(int $state) : boolWhether the block's state can change with its neighbours (fences, walls, bars, panes, stairs).
updateFromNeighbourShapes()
public function updateFromNeighbourShapes(\pocketmine\world\generator\vanilla\feature\FeatureLevel $level, int $x, int $y, int $z) : voidBlock.updateFromNeighbourShapes() + setBlock() if the state changed.
updateShape()
public function updateShape(\pocketmine\world\generator\vanilla\feature\FeatureLevel $level, int $state, int $x, int $y, int $z, int $direction, int $neighbour) : intBlockState.updateShape(direction, neighbour) for the supported blocks; other states are returned unchanged.
