Skip to content

FreeSpace 5.46.0 ​

final class · pocketmine\world\generator\vanilla\structure\jigsaw\FreeSpace · source

The space where jigsaw pieces may still be placed: vanilla's VoxelShape (a box minus the boxes of placed pieces), for block-aligned boxes. A piece fits when its box (deflated by 0.25 in vanilla) is inside the outer box and does not overlap any placed box.

The placed boxes are kept in a grid of 16-block cells, so a fit check only looks at the boxes near the candidate: a trial chambers start places ~500 pieces after trying thousands of candidates, and checking every candidate against every placed box took seconds.

Methods ​

__construct() ​

php
public function __construct(\pocketmine\world\generator\vanilla\structure\BoundingBox $outer)

fits() ​

php
public function fits(\pocketmine\world\generator\vanilla\structure\BoundingBox $box) : bool

subtract() ​

php
public function subtract(\pocketmine\world\generator\vanilla\structure\BoundingBox $box) : void

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.