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

Public Member Functions

 __construct (array $options=[])
 
 getName ()
 
 getWaterHeight ()
 
 getSettings ()
 
 init (ChunkManager $level, Random $random)
 
 generateChunk ($chunkX, $chunkZ)
 
 populateChunk ($chunkX, $chunkZ)
 
 getSpawn ()
 
- Public Member Functions inherited from Generator
 getWaterHeight ()
 
 __construct (array $settings=[])
 
 init (ChunkManager $level, Random $random)
 
 generateChunk ($chunkX, $chunkZ)
 
 populateChunk ($chunkX, $chunkZ)
 
 getSettings ()
 
 getName ()
 
 getSpawn ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Generator
static addGenerator ($object, $name)
 
static getGeneratorList ()
 
static getGenerator ($name)
 
static getGeneratorName ($class)
 
static getFastNoise1D (Noise $noise, $xSize, $samplingRate, $x, $y, $z)
 
static getFastNoise2D (Noise $noise, $xSize, $zSize, $samplingRate, $x, $y, $z)
 
static getFastNoise3D (Noise $noise, $xSize, $ySize, $zSize, $xSamplingRate, $ySamplingRate, $zSamplingRate, $x, $y, $z)
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( array  $options = [])
38  {
39  if (self::$GAUSSIAN_KERNEL === null) {
40  self::generateKernel();
41  }
42  }

Member Function Documentation

◆ generateChunk()

generateChunk (   $chunkX,
  $chunkZ 
)
91  {
92  $this->random->setSeed(0xa6fe78dc ^ ($chunkX << 8) ^ $chunkZ ^ $this->level->getSeed());
93 
94  $noise = Generator::getFastNoise3D($this->noiseBase, 16, 128, 16, 4, 8, 4, $chunkX * 16, 0, $chunkZ * 16);
95 
96  $chunk = $this->level->getChunk($chunkX, $chunkZ);
97 
98  for ($x = 0; $x < 16; ++$x) {
99  for ($z = 0; $z < 16; ++$z) {
100 
101  $biome = Biome::getBiome(Biome::END);
102  $biome->setGroundCover([
104 
105  ]);
106  $chunk->setBiomeId($x, $z, $biome->getId());
107  $color = [0, 0, 0];
108  $bColor = 2;
109  $color[0] += (($bColor >> 16) ** 2);
110  $color[1] += ((($bColor >> 8) & 0xff) ** 2);
111  $color[2] += (($bColor & 0xff) ** 2);
112 
113  //$chunk->setBiomeColor($x, $z, $color[0], $color[1], $color[2]);
114 
115  for ($y = 0; $y < 128; ++$y) {
116 
117  $noiseValue = (abs($this->emptyHeight - $y) / $this->emptyHeight) * $this->emptyAmplitude - $noise[$x][$z][$y];
118  $noiseValue -= 1 - $this->density;
119 
120  $distance = new Vector3(0, 64, 0);
121  $distance = $distance->distance(new Vector3($chunkX * 16 + $x, ($y / 1.3), $chunkZ * 16 + $z));
122 
123  if ($noiseValue < 0 && $distance < 100 or $noiseValue < -0.2 && $distance > 400) {
124  $chunk->setBlockId($x, $y, $z, Block::END_STONE);
125  }
126  }
127  }
128  }
129 
130  foreach ($this->generationPopulators as $populator) {
131  $populator->populate($this->level, $chunkX, $chunkZ, $this->random);
132  }
133  }

◆ getName()

getName ( )
62  : string
63  {
64  return "Ender";
65  }

◆ getSettings()

getSettings ( )
73  {
74  return [];
75  }

◆ getSpawn()

getSpawn ( )
148  {
149  return new Vector3(48, 128, 48);
150  }

◆ getWaterHeight()

getWaterHeight ( )
67  : int
68  {
69  return $this->waterHeight;
70  }

◆ init()

init ( ChunkManager  $level,
Random  $random 
)
78  {
79  $this->level = $level;
80  $this->random = $random;
81  $this->random->setSeed($this->level->getSeed());
82  $this->noiseBase = new Simplex($this->random, 4, 1 / 4, 1 / 64);
83  $this->random->setSeed($this->level->getSeed());
84  $pilar = new EnderPilar();
85  $pilar->setBaseAmount(0);
86  $pilar->setRandomAmount(0);
87  $this->populators[] = $pilar;
88  }

◆ populateChunk()

populateChunk (   $chunkX,
  $chunkZ 
)
136  {
137  $this->random->setSeed(0xa6fe78dc ^ ($chunkX << 8) ^ $chunkZ ^ $this->level->getSeed());
138  foreach ($this->populators as $populator) {
139  $populator->populate($this->level, $chunkX, $chunkZ, $this->random);
140  }
141 
142  $chunk = $this->level->getChunk($chunkX, $chunkZ);
143  $biome = Biome::getBiome($chunk->getBiomeId(7, 7));
144  $biome->populateChunk($this->level, $chunkX, $chunkZ, $this->random);
145  }

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