◆ addType()
- Parameters
-
55 $this->flowerTypes[] = $type;
◆ getTypes()
- Returns
- array
62 return $this->flowerTypes;
◆ populate()
- Parameters
-
- Returns
- mixed|void
74 $this->level = $level;
75 $amount = $random->nextRange(0, $this->randomAmount + 1) + $this->baseAmount;
77 if(count($this->flowerTypes) === 0){
82 $endNum = count($this->flowerTypes) - 1;
84 for($i = 0; $i < $amount; ++$i){
85 $x = $random->nextRange($chunkX * 16, $chunkX * 16 + 15);
86 $z = $random->nextRange($chunkZ * 16, $chunkZ * 16 + 15);
87 $y = $this->getHighestWorkableBlock($x, $z);
88 if($y !== -1 and $this->canFlowerStay($x, $y, $z)){
89 $type = mt_rand(0, $endNum);
90 $this->level->setBlockIdAt($x, $y, $z, $this->flowerTypes[$type][0]);
91 $this->level->setBlockDataAt($x, $y, $z, $this->flowerTypes[$type][1]);
◆ setBaseAmount()
- Parameters
-
48 $this->baseAmount = $amount;
◆ setRandomAmount()
setRandomAmount |
( |
|
$amount | ) |
|
- Parameters
-
41 $this->randomAmount = $amount;
The documentation for this class was generated from the following file:
- src/pocketmine/level/generator/populator/Flower.php