mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 20:28:31 +00:00
Biome: make biomes list use an SplFixedArray
This commit is contained in:
parent
c8a87b14d5
commit
8c6161a4f2
@ -52,8 +52,8 @@ abstract class Biome{
|
|||||||
|
|
||||||
public const MAX_BIOMES = 256;
|
public const MAX_BIOMES = 256;
|
||||||
|
|
||||||
/** @var Biome[] */
|
/** @var Biome[]|\SplFixedArray */
|
||||||
private static $biomes = [];
|
private static $biomes;
|
||||||
|
|
||||||
/** @var int */
|
/** @var int */
|
||||||
private $id;
|
private $id;
|
||||||
@ -82,6 +82,8 @@ abstract class Biome{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static function init(){
|
public static function init(){
|
||||||
|
self::$biomes = new \SplFixedArray(self::MAX_BIOMES);
|
||||||
|
|
||||||
self::register(self::OCEAN, new OceanBiome());
|
self::register(self::OCEAN, new OceanBiome());
|
||||||
self::register(self::PLAINS, new PlainBiome());
|
self::register(self::PLAINS, new PlainBiome());
|
||||||
self::register(self::DESERT, new DesertBiome());
|
self::register(self::DESERT, new DesertBiome());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user