diff --git a/src/pocketmine/level/generator/Flat.php b/src/pocketmine/level/generator/Flat.php index 006d8f385..e738baecf 100644 --- a/src/pocketmine/level/generator/Flat.php +++ b/src/pocketmine/level/generator/Flat.php @@ -141,7 +141,7 @@ class Flat extends Generator{ } } - public function generateChunk(int $chunkX, int $chunkZ){ + public function generateChunk(int $chunkX, int $chunkZ) : void{ if($this->chunk === null){ if(isset($this->options["preset"]) and $this->options["preset"] != ""){ $this->generateBaseChunk($this->options["preset"]); @@ -155,7 +155,7 @@ class Flat extends Generator{ $this->level->setChunk($chunkX, $chunkZ, $chunk); } - public function populateChunk(int $chunkX, int $chunkZ){ + public function populateChunk(int $chunkX, int $chunkZ) : void{ $this->random->setSeed(0xdeadbeef ^ ($chunkX << 8) ^ $chunkZ ^ $this->level->getSeed()); foreach($this->populators as $populator){ $populator->populate($this->level, $chunkX, $chunkZ, $this->random); diff --git a/src/pocketmine/level/generator/Generator.php b/src/pocketmine/level/generator/Generator.php index e1d4dce21..44b47d90d 100644 --- a/src/pocketmine/level/generator/Generator.php +++ b/src/pocketmine/level/generator/Generator.php @@ -60,14 +60,14 @@ abstract class Generator{ abstract public function __construct(array $settings = []); - public function init(ChunkManager $level, Random $random){ + public function init(ChunkManager $level, Random $random) : void{ $this->level = $level; $this->random = $random; } - abstract public function generateChunk(int $chunkX, int $chunkZ); + abstract public function generateChunk(int $chunkX, int $chunkZ) : void; - abstract public function populateChunk(int $chunkX, int $chunkZ); + abstract public function populateChunk(int $chunkX, int $chunkZ) : void; abstract public function getSettings() : array; diff --git a/src/pocketmine/level/generator/hell/Nether.php b/src/pocketmine/level/generator/hell/Nether.php index 5ea427804..d4d3eb3a8 100644 --- a/src/pocketmine/level/generator/hell/Nether.php +++ b/src/pocketmine/level/generator/hell/Nether.php @@ -62,7 +62,7 @@ class Nether extends Generator{ return []; } - public function init(ChunkManager $level, Random $random){ + public function init(ChunkManager $level, Random $random) : void{ parent::init($level, $random); $this->random->setSeed($this->level->getSeed()); $this->noiseBase = new Simplex($this->random, 4, 1 / 4, 1 / 64); @@ -82,7 +82,7 @@ class Nether extends Generator{ $this->populators[] = $ores;*/ } - public function generateChunk(int $chunkX, int $chunkZ){ + public function generateChunk(int $chunkX, int $chunkZ) : void{ $this->random->setSeed(0xdeadbeef ^ ($chunkX << 8) ^ $chunkZ ^ $this->level->getSeed()); $noise = $this->noiseBase->getFastNoise3D(16, 128, 16, 4, 8, 4, $chunkX * 16, 0, $chunkZ * 16); @@ -117,7 +117,7 @@ class Nether extends Generator{ } } - public function populateChunk(int $chunkX, int $chunkZ){ + public function populateChunk(int $chunkX, int $chunkZ) : void{ $this->random->setSeed(0xdeadbeef ^ ($chunkX << 8) ^ $chunkZ ^ $this->level->getSeed()); foreach($this->populators as $populator){ $populator->populate($this->level, $chunkX, $chunkZ, $this->random); diff --git a/src/pocketmine/level/generator/normal/Normal.php b/src/pocketmine/level/generator/normal/Normal.php index 0a4692b15..88ddf3619 100644 --- a/src/pocketmine/level/generator/normal/Normal.php +++ b/src/pocketmine/level/generator/normal/Normal.php @@ -62,7 +62,7 @@ class Normal extends Generator{ } } - private static function generateKernel(){ + private static function generateKernel() : void{ self::$GAUSSIAN_KERNEL = []; $bellSize = 1 / self::$SMOOTH_SIZE; @@ -87,7 +87,7 @@ class Normal extends Generator{ return []; } - private function pickBiome(int $x, int $z){ + private function pickBiome(int $x, int $z) : Biome{ $hash = $x * 2345803 ^ $z * 9236449 ^ $this->level->getSeed(); $hash *= $hash + 223; $xNoise = $hash >> 20 & 3; @@ -102,7 +102,7 @@ class Normal extends Generator{ return $this->selector->pickBiome($x + $xNoise - 1, $z + $zNoise - 1); } - public function init(ChunkManager $level, Random $random){ + public function init(ChunkManager $level, Random $random) : void{ parent::init($level, $random); $this->random->setSeed($this->level->getSeed()); $this->noiseBase = new Simplex($this->random, 4, 1 / 4, 1 / 32); @@ -177,7 +177,7 @@ class Normal extends Generator{ $this->populators[] = $ores; } - public function generateChunk(int $chunkX, int $chunkZ){ + public function generateChunk(int $chunkX, int $chunkZ) : void{ $this->random->setSeed(0xdeadbeef ^ ($chunkX << 8) ^ $chunkZ ^ $this->level->getSeed()); $noise = $this->noiseBase->getFastNoise3D(16, 128, 16, 4, 8, 4, $chunkX * 16, 0, $chunkZ * 16); @@ -244,7 +244,7 @@ class Normal extends Generator{ } } - public function populateChunk(int $chunkX, int $chunkZ){ + public function populateChunk(int $chunkX, int $chunkZ) : void{ $this->random->setSeed(0xdeadbeef ^ ($chunkX << 8) ^ $chunkZ ^ $this->level->getSeed()); foreach($this->populators as $populator){ $populator->populate($this->level, $chunkX, $chunkZ, $this->random);