mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 19:02:59 +00:00
Chunk: removed heighArray parameter from constructor
we don't pass this anywhere, and really it should be dynamically initialized anyway, just like light.
This commit is contained in:
@ -69,7 +69,7 @@ class Chunk{
|
||||
/**
|
||||
* @param SubChunk[] $subChunks
|
||||
*/
|
||||
public function __construct(array $subChunks = [], ?BiomeArray $biomeIds = null, ?HeightArray $heightMap = null, bool $terrainPopulated = false){
|
||||
public function __construct(array $subChunks = [], ?BiomeArray $biomeIds = null, bool $terrainPopulated = false){
|
||||
$this->subChunks = new \SplFixedArray(Chunk::MAX_SUBCHUNKS);
|
||||
|
||||
foreach($this->subChunks as $y => $null){
|
||||
@ -77,7 +77,7 @@ class Chunk{
|
||||
}
|
||||
|
||||
$val = ($this->subChunks->getSize() * SubChunk::EDGE_LENGTH);
|
||||
$this->heightMap = $heightMap ?? new HeightArray(array_fill(0, 256, $val));
|
||||
$this->heightMap = new HeightArray(array_fill(0, 256, $val)); //TODO: what about lazily initializing this?
|
||||
$this->biomeIds = $biomeIds ?? BiomeArray::fill(BiomeIds::OCEAN);
|
||||
|
||||
$this->terrainPopulated = $terrainPopulated;
|
||||
|
Reference in New Issue
Block a user