diff --git a/src/world/format/Chunk.php b/src/world/format/Chunk.php index fe37161b81..42daa1bcba 100644 --- a/src/world/format/Chunk.php +++ b/src/world/format/Chunk.php @@ -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; diff --git a/src/world/format/io/FastChunkSerializer.php b/src/world/format/io/FastChunkSerializer.php index 62a22352ed..bb8bec687a 100644 --- a/src/world/format/io/FastChunkSerializer.php +++ b/src/world/format/io/FastChunkSerializer.php @@ -115,6 +115,6 @@ final class FastChunkSerializer{ $biomeIds = new BiomeArray($stream->get(256)); - return new Chunk($subChunks, $biomeIds, null, $terrainPopulated); + return new Chunk($subChunks, $biomeIds, $terrainPopulated); } } diff --git a/src/world/format/io/leveldb/LevelDB.php b/src/world/format/io/leveldb/LevelDB.php index 2ab5ef0cb6..17f42f7bdd 100644 --- a/src/world/format/io/leveldb/LevelDB.php +++ b/src/world/format/io/leveldb/LevelDB.php @@ -417,7 +417,6 @@ class LevelDB extends BaseWorldProvider implements WritableWorldProvider{ $chunk = new Chunk( $subChunks, $biomeArray, - null, $terrainPopulated ); diff --git a/src/world/format/io/region/LegacyAnvilChunkTrait.php b/src/world/format/io/region/LegacyAnvilChunkTrait.php index 4f6ce4123f..a7181718fd 100644 --- a/src/world/format/io/region/LegacyAnvilChunkTrait.php +++ b/src/world/format/io/region/LegacyAnvilChunkTrait.php @@ -92,7 +92,6 @@ trait LegacyAnvilChunkTrait{ new Chunk( $subChunks, $biomeArray, - null, $chunk->getByte("TerrainPopulated", 0) !== 0 ), ($entitiesTag = $chunk->getTag("Entities")) instanceof ListTag ? self::getCompoundList("Entities", $entitiesTag) : [], diff --git a/src/world/format/io/region/McRegion.php b/src/world/format/io/region/McRegion.php index 0aac961590..d4864f934c 100644 --- a/src/world/format/io/region/McRegion.php +++ b/src/world/format/io/region/McRegion.php @@ -86,7 +86,6 @@ class McRegion extends RegionWorldProvider{ new Chunk( $subChunks, $biomeIds, - null, $chunk->getByte("TerrainPopulated", 0) !== 0 ), ($entitiesTag = $chunk->getTag("Entities")) instanceof ListTag ? self::getCompoundList("Entities", $entitiesTag) : [],