public function placeObject(ChunkManager $level, $x, $y, $z, Random $random)
{
$this->random = $random;
$this->trunkHeight = (int) ($this->totalHeight * $this->trunkHeightMultiplier);
$leaves = $this->getLeafGroupPoints($level, $x, $y, $z);
foreach ($leaves as $leaf) {
/** @var Vector3 $leafGroup */
$leafGroup = $leaf[0];
$groupX = $leafGroup->getX();
$groupY = $leafGroup->getY();
$groupZ = $leafGroup->getZ();
for ($yy = $groupY; $yy < $groupY + $this->leafDistanceLimit; ++$yy) {
$this->generateGroupLayer($level, $groupX, $yy, $groupZ, $this->getLeafGroupLayerSize($yy - $groupY));
}
}
$trunk = new VectorIterator($level, new Vector3($x, $y - 1, $z), new Vector3($x, $y + $this->trunkHeight, $z));
while ($trunk->valid()) {
$trunk->next();
$pos = $trunk->current();
$level->setBlockIdAt($pos->x, $pos->y, $pos->z, Block::LOG);
}
$this->generateBranches($level, $x, $y, $z, $leaves);
}