22declare(strict_types=1);
24namespace pocketmine\world\generator\object;
36 public static function growGrass(
ChunkManager $world,
Vector3 $pos,
Random $random,
int $count = 15,
int $radius = 10) :
void{
39 VanillaBlocks::DANDELION(),
40 VanillaBlocks::POPPY(),
41 $tallGrass = VanillaBlocks::TALL_GRASS(),
46 $arrC = count($arr) - 1;
47 for($c = 0; $c < $count; ++$c){
48 $x = $random->
nextRange($pos->x - $radius, $pos->x + $radius);
49 $z = $random->
nextRange($pos->z - $radius, $pos->z + $radius);
50 if($world->
getBlockAt($x, $pos->y + 1, $z)->getTypeId() === BlockTypeIds::AIR && $world->
getBlockAt($x, $pos->y, $z)->getTypeId() === BlockTypeIds::GRASS){
nextRange(int $start=0, int $end=0x7fffffff)
getBlockAt(int $x, int $y, int $z)
setBlockAt(int $x, int $y, int $z, Block $block)