GenisysPro  for Minecraft PE/Windows 10 v1.1.x
Feature-rich server software for Minecraft PE and Windows 10 Edition
EnderPilar Class Reference

Public Member Functions

 setRandomAmount ($amount)
 
 setBaseAmount ($amount)
 
 populate (ChunkManager $level, $chunkX, $chunkZ, Random $random)
 
- Public Member Functions inherited from Populator
 populate (ChunkManager $level, $chunkX, $chunkZ, Random $random)
 

Member Function Documentation

◆ populate()

populate ( ChunkManager  $level,
  $chunkX,
  $chunkZ,
Random  $random 
)
28  {
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);
36  if ($this->level->getBlockIdAt($x, $y, $z) == Block::END_STONE) {
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);
43  }
44  }
45  }
46  }
47  }
48  }
49  }

◆ setBaseAmount()

setBaseAmount (   $amount)
23  {
24  $this->baseAmount = $amount;
25  }

◆ setRandomAmount()

setRandomAmount (   $amount)
18  {
19  $this->randomAmount = $amount;
20  }

The documentation for this class was generated from the following file: