◆ growGrass()
- Parameters
-
ChunkManager | $level | |
Vector3 | $pos | |
Random | $random | |
int | $count | |
int | $radius | |
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($level->getBlockIdAt($x, $pos->y + 1, $z) ===
Block::AIR and $level->getBlockIdAt($x, $pos->y, $z) ===
Block::GRASS){
51 $t = $arr[$random->nextRange(0, $arrC)];
52 $level->setBlockIdAt($x, $pos->y + 1, $z, $t[0]);
53 $level->setBlockDataAt($x, $pos->y + 1, $z, $t[1]);
The documentation for this class was generated from the following file:
- src/pocketmine/level/generator/object/TallGrass.php