/**
* @param LevelProvider $provider
* @param int $x
* @param int $z
* @param string $blocks
* @param string $data
* @param string $skyLight
* @param string $blockLight
* @param string $biomeIds
* @param int[] $biomeColors
* @param int[] $heightMap
* @param Compound[] $entities
* @param Compound[] $tiles
*/
protected function __construct($provider, $x, $z, $blocks, $data, $skyLight, $blockLight, $biomeIds = null, array $biomeColors = [], array $heightMap = [], array $entities = [], array $tiles = [])
{
$this->provider = $provider;
$this->x = (int) $x;
$this->z = (int) $z;
$this->blocks = $blocks;
$this->data = $data;
$this->skyLight = $skyLight;
$this->blockLight = $blockLight;
if (strlen($biomeIds) === 256) {
$this->biomeIds = $biomeIds;
} else {
$this->biomeIds = str_repeat("", 256);
}
if (count($biomeColors) === 256) {
$this->biomeColors = $biomeColors;
} else {
$this->biomeColors = array_fill(0, 256, Binary::readInt("…²J"));
}
if (count($heightMap) === 256) {
$this->heightMap = $heightMap;
} else {
$this->heightMap = array_fill(0, 256, 127);
}
$this->NBTtiles = $tiles;
$this->NBTentities = $entities;
}