◆ populate()
29 if (mt_rand(0, 100) < 10) {
30 $this->level = $level;
31 $amount = $random->nextRange(0, $this->randomAmount + 1) + $this->baseAmount;
32 for ($i = 0; $i < $amount; ++$i) {
33 $x = $random->nextRange($chunkX * 16, $chunkX * 16 + 15);
34 $z = $random->nextRange($chunkZ * 16, $chunkZ * 16 + 15);
35 $y = $this->getHighestWorkableBlock($x, $z);
37 $height = mt_rand(28, 50);
38 for ($ny = $y; $ny < $y + $height; $ny++) {
39 for ($r = 0.5; $r < 5; $r += 0.5) {
40 $nd = 360 / (2 * pi() * $r);
41 for ($d = 0; $d < 360; $d += $nd) {
42 $level->setBlockIdAt($x + (cos(deg2rad($d)) * $r), $ny, $z + (sin(deg2rad($d)) * $r),
Block::OBSIDIAN);
◆ setBaseAmount()
24 $this->baseAmount = $amount;
◆ setRandomAmount()
setRandomAmount |
( |
|
$amount | ) |
|
19 $this->randomAmount = $amount;
The documentation for this class was generated from the following file:
- src/pocketmine/level/generator/ender/populator/EnderPilar.php