populate missing array value types in level namespace

This commit is contained in:
Dylan K. Taylor 2020-01-30 21:01:59 +00:00
parent 8bf469f7fc
commit a5764b3ae9
8 changed files with 25 additions and 0 deletions

View File

@ -1137,6 +1137,9 @@ class Level implements ChunkManager, Metadatable{
} }
} }
/**
* @return mixed[]
*/
public function __debugInfo() : array{ public function __debugInfo() : array{
return []; return [];
} }

View File

@ -53,6 +53,8 @@ interface LevelProvider{
/** /**
* Generate the needed files in the path given * Generate the needed files in the path given
* *
* @param mixed[] $options
*
* @return void * @return void
*/ */
public static function generate(string $path, string $name, int $seed, string $generator, array $options = []); public static function generate(string $path, string $name, int $seed, string $generator, array $options = []);
@ -62,6 +64,9 @@ interface LevelProvider{
*/ */
public function getGenerator() : string; public function getGenerator() : string;
/**
* @return mixed[]
*/
public function getGeneratorOptions() : array; public function getGeneratorOptions() : array;
/** /**

View File

@ -64,6 +64,8 @@ class Flat extends Generator{
} }
/** /**
* @param mixed[] $options
*
* @throws InvalidGeneratorOptionsException * @throws InvalidGeneratorOptionsException
*/ */
public function __construct(array $options = []){ public function __construct(array $options = []){

View File

@ -56,6 +56,8 @@ abstract class Generator{
/** /**
* @throws InvalidGeneratorOptionsException * @throws InvalidGeneratorOptionsException
*
* @param mixed[] $settings
*/ */
abstract public function __construct(array $settings = []); abstract public function __construct(array $settings = []);
@ -68,6 +70,9 @@ abstract class Generator{
abstract public function populateChunk(int $chunkX, int $chunkZ) : void; abstract public function populateChunk(int $chunkX, int $chunkZ) : void;
/**
* @return mixed[]
*/
abstract public function getSettings() : array; abstract public function getSettings() : array;
abstract public function getName() : string; abstract public function getName() : string;

View File

@ -45,6 +45,9 @@ class GeneratorRegisterTask extends AsyncTask{
/** @var int */ /** @var int */
public $worldHeight = Level::Y_MAX; public $worldHeight = Level::Y_MAX;
/**
* @param mixed[] $generatorSettings
*/
public function __construct(Level $level, string $generatorClass, array $generatorSettings = []){ public function __construct(Level $level, string $generatorClass, array $generatorSettings = []){
$this->generatorClass = $generatorClass; $this->generatorClass = $generatorClass;
$this->settings = serialize($generatorSettings); $this->settings = serialize($generatorSettings);

View File

@ -53,6 +53,8 @@ class Nether extends Generator{
private $noiseBase; private $noiseBase;
/** /**
* @param mixed[] $options
*
* @throws InvalidGeneratorOptionsException * @throws InvalidGeneratorOptionsException
*/ */
public function __construct(array $options = []){ public function __construct(array $options = []){

View File

@ -307,6 +307,9 @@ abstract class Noise{
return $noiseArray; return $noiseArray;
} }
/**
* @return float[][][]
*/
public function getFastNoise3D(int $xSize, int $ySize, int $zSize, int $xSamplingRate, int $ySamplingRate, int $zSamplingRate, int $x, int $y, int $z) : array{ public function getFastNoise3D(int $xSize, int $ySize, int $zSize, int $xSamplingRate, int $ySamplingRate, int $zSamplingRate, int $x, int $y, int $z) : array{
assert($xSamplingRate !== 0, new \InvalidArgumentException("xSamplingRate cannot be 0")); assert($xSamplingRate !== 0, new \InvalidArgumentException("xSamplingRate cannot be 0"));

View File

@ -61,6 +61,8 @@ class Normal extends Generator{
private static $SMOOTH_SIZE = 2; private static $SMOOTH_SIZE = 2;
/** /**
* @param mixed[] $options
*
* @throws InvalidGeneratorOptionsException * @throws InvalidGeneratorOptionsException
*/ */
public function __construct(array $options = []){ public function __construct(array $options = []){