mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 02:08:21 +00:00
added SplFixedArray generics for phpstan 0.12.9
This commit is contained in:
@ -247,7 +247,10 @@ class Level implements ChunkManager, Metadatable{
|
||||
/** @var Vector3 */
|
||||
private $temporalVector;
|
||||
|
||||
/** @var \SplFixedArray */
|
||||
/**
|
||||
* @var \SplFixedArray
|
||||
* @phpstan-var \SplFixedArray<Block>
|
||||
*/
|
||||
private $blockStates;
|
||||
|
||||
/** @var int */
|
||||
@ -1038,6 +1041,9 @@ class Level implements ChunkManager, Metadatable{
|
||||
unset($this->chunkCache[Level::chunkHash($chunkX, $chunkZ)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @phpstan-return \SplFixedArray<Block>
|
||||
*/
|
||||
public function getRandomTickedBlocks() : \SplFixedArray{
|
||||
return $this->randomTickBlocks;
|
||||
}
|
||||
|
@ -49,7 +49,10 @@ abstract class Biome{
|
||||
|
||||
public const MAX_BIOMES = 256;
|
||||
|
||||
/** @var Biome[]|\SplFixedArray */
|
||||
/**
|
||||
* @var Biome[]|\SplFixedArray
|
||||
* @phpstan-var \SplFixedArray<Biome>
|
||||
*/
|
||||
private static $biomes;
|
||||
|
||||
/** @var int */
|
||||
|
@ -72,7 +72,10 @@ class Chunk{
|
||||
/** @var int */
|
||||
protected $height = Chunk::MAX_SUBCHUNKS;
|
||||
|
||||
/** @var \SplFixedArray|SubChunkInterface[] */
|
||||
/**
|
||||
* @var \SplFixedArray|SubChunkInterface[]
|
||||
* @phpstan-var \SplFixedArray<SubChunkInterface>
|
||||
*/
|
||||
protected $subChunks;
|
||||
|
||||
/** @var EmptySubChunk */
|
||||
@ -86,7 +89,10 @@ class Chunk{
|
||||
/** @var Entity[] */
|
||||
protected $entities = [];
|
||||
|
||||
/** @var \SplFixedArray|int[] */
|
||||
/**
|
||||
* @var \SplFixedArray|int[]
|
||||
* @phpstan-var \SplFixedArray<int>
|
||||
*/
|
||||
protected $heightMap;
|
||||
|
||||
/** @var string */
|
||||
@ -784,6 +790,7 @@ class Chunk{
|
||||
|
||||
/**
|
||||
* @return \SplFixedArray|SubChunkInterface[]
|
||||
* @phpstan-return \SplFixedArray<SubChunkInterface>
|
||||
*/
|
||||
public function getSubChunks() : \SplFixedArray{
|
||||
return $this->subChunks;
|
||||
|
@ -34,7 +34,10 @@ abstract class BiomeSelector{
|
||||
/** @var Simplex */
|
||||
private $rainfall;
|
||||
|
||||
/** @var Biome[]|\SplFixedArray */
|
||||
/**
|
||||
* @var Biome[]|\SplFixedArray
|
||||
* @phpstan-var \SplFixedArray<Biome>
|
||||
*/
|
||||
private $map = null;
|
||||
|
||||
public function __construct(Random $random){
|
||||
|
@ -247,6 +247,10 @@ abstract class Noise{
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \SplFixedArray|float[]
|
||||
* @phpstan-return \SplFixedArray<float>
|
||||
*/
|
||||
public function getFastNoise1D(int $xSize, int $samplingRate, int $x, int $y, int $z) : \SplFixedArray{
|
||||
if($samplingRate === 0){
|
||||
throw new \InvalidArgumentException("samplingRate cannot be 0");
|
||||
@ -271,6 +275,10 @@ abstract class Noise{
|
||||
return $noiseArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \SplFixedArray|float[][]
|
||||
* @phpstan-return \SplFixedArray<\SplFixedArray<float>>
|
||||
*/
|
||||
public function getFastNoise2D(int $xSize, int $zSize, int $samplingRate, int $x, int $y, int $z) : \SplFixedArray{
|
||||
assert($samplingRate !== 0, new \InvalidArgumentException("samplingRate cannot be 0"));
|
||||
|
||||
|
Reference in New Issue
Block a user