mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
and more typehints
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user