and more typehints

This commit is contained in:
Dylan K. Taylor
2017-07-14 10:56:51 +01:00
parent b9355387da
commit c3b8be3f60
119 changed files with 598 additions and 541 deletions

View File

@ -50,11 +50,11 @@ class Flat extends Generator{
private $populators = [];
private $structure, $chunks, $options, $floorLevel, $preset;
public function getSettings(){
public function getSettings() : array{
return $this->options;
}
public function getName(){
public function getName() : string{
return "flat";
}
@ -155,7 +155,7 @@ class Flat extends Generator{
*/
}
public function generateChunk($chunkX, $chunkZ){
public function generateChunk(int $chunkX, int $chunkZ){
if($this->chunk === null){
if(isset($this->options["preset"]) and $this->options["preset"] != ""){
$this->parsePreset($this->options["preset"], $chunkX, $chunkZ);
@ -169,7 +169,7 @@ class Flat extends Generator{
$this->level->setChunk($chunkX, $chunkZ, $chunk);
}
public function populateChunk($chunkX, $chunkZ){
public function populateChunk(int $chunkX, int $chunkZ){
$this->random->setSeed(0xdeadbeef ^ ($chunkX << 8) ^ $chunkZ ^ $this->level->getSeed());
foreach($this->populators as $populator){
$populator->populate($this->level, $chunkX, $chunkZ, $this->random);
@ -177,7 +177,7 @@ class Flat extends Generator{
}
public function getSpawn(){
public function getSpawn() : Vector3{
return new Vector3(128, $this->floorLevel, 128);
}
}