PistonStructureResolver 5.46.0
Finds the blocks moved and destroyed by a piston: the line of blocks in front of it, plus the blocks dragged along by slime and honey blocks. Same algorithm as vanilla's piston structure resolver (also used by PowerNukkitX), with Bedrock's limit of 12 moved blocks.
Constants
MAX_PUSHED_BLOCKS
php
public const MAX_PUSHED_BLOCKS = 12Methods
__construct()
php
public function __construct(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pistonPos, int $pistonFacing, bool $extending)getBlocksToDestroy()
php
public function getBlocksToDestroy() : arraygetBlocksToPush()
php
public function getBlocksToPush() : arraygetPushDirection()
php
public function getPushDirection() : intresolve()
php
public function resolve() : boolComputes the blocks to move and destroy. Returns false if the piston can't move them (immovable block in the way, more than 12 blocks, or the edge of the world).
