◆ populate()
- Parameters
-
- Returns
- mixed|void
57 $this->level = $level;
58 $amount = $random->nextRange(0, $this->randomAmount + 1) + $this->baseAmount;
59 for($i = 0; $i < $amount; ++$i){
60 $x = $random->nextRange($chunkX * 16, $chunkX * 16 + 15);
61 $z = $random->nextRange($chunkZ * 16, $chunkZ * 16 + 15);
62 $y = $this->getHighestWorkableBlock($x, $z);
63 $tallRand = $random->nextRange(0, 17);
64 $yMax = $y + 1 + (int) ($tallRand > 10) + (int) ($tallRand > 15);
67 for(; $y < 127 and $y < $yMax; $y++){
68 if($this->canCactusStay($x, $y, $z)){
70 $this->level->setBlockDataAt($x, $y, $z, 1);
◆ setBaseAmount()
- Parameters
-
45 $this->baseAmount = $amount;
◆ setRandomAmount()
setRandomAmount |
( |
|
$amount | ) |
|
- Parameters
-
38 $this->randomAmount = $amount;
The documentation for this class was generated from the following file:
- src/pocketmine/level/generator/populator/Cactus.php