private function generateBranches(ChunkManager $level, int $x, int $y, int $z, array $groups)
{
foreach ($groups as $group) {
$baseY = $group[1];
if ($baseY - $y >= $this->totalHeight * 0.2) {
$base = new Vector3($x, $baseY, $z);
$branch = new VectorIterator($level, $base, $group[0]);
while ($branch->valid()) {
$branch->next();
$pos = $branch->current();
$level->setBlockIdAt((int) $pos->x, (int) $pos->y, (int) $pos->z, Block::LOG);
$level->updateBlockLight((int) $pos->x, (int) $pos->y, (int) $pos->z);
}
}
}
}