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

Public Member Functions

 getSettings ()
 
 getName ()
 
 __construct (array $settings=[])
 
 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  $settings = [])

Void constructor.

Parameters
array$settings
60  {
61  $this->options = $settings;
62  }

Member Function Documentation

◆ generateChunk()

generateChunk (   $chunkX,
  $chunkZ 
)
Parameters
$chunkX
$chunkZ
Returns
mixed|void
81  {
82  if($this->emptyChunk === null){
83  $this->chunk = clone $this->level->getChunk($chunkX, $chunkZ);
84  $this->chunk->setGenerated();
85 
86  for($Z = 0; $Z < 16; ++$Z){
87  for($X = 0; $X < 16; ++$X){
88  $this->chunk->setBiomeId($X, $Z, 1);
89  for($y = 0; $y < 128; ++$y){
90  $this->chunk->setBlockId($X, $y, $Z, Block::AIR);
91  }
92  }
93  }
94 
95  $spawn = $this->getSpawn();
96  if($spawn->getX() >> 4 === $chunkX and $spawn->getZ() >> 4 === $chunkZ){
97  $this->chunk->setBlockId(0, 64, 0, Block::GRASS);
98  }else{
99  $this->emptyChunk = clone $this->chunk;
100  }
101  }else{
102  $this->chunk = clone $this->emptyChunk;
103  }
104 
105  $chunk = clone $this->chunk;
106  $chunk->setX($chunkX);
107  $chunk->setZ($chunkZ);
108  $this->level->setChunk($chunkX, $chunkZ, $chunk);
109  }

◆ getName()

getName ( )
Returns
string
51  {
52  return "Void";
53  }

◆ getSettings()

getSettings ( )
Returns
array
44  {
45  return [];
46  }

◆ getSpawn()

getSpawn ( )
Returns
Vector3
124  {
125  return new Vector3(128, 72, 128);
126  }

◆ init()

init ( ChunkManager  $level,
Random  $random 
)
Parameters
ChunkManager$level
Random$random
Returns
mixed|void
70  {
71  $this->level = $level;
72  $this->random = $random;
73  }

◆ populateChunk()

populateChunk (   $chunkX,
  $chunkZ 
)
Parameters
$chunkX
$chunkZ
Returns
mixed|void
117  {
118 
119  }

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