52 if(strlen($biomes2d) !== 256){
53 throw new \InvalidArgumentException(
"Biome array is expected to be exactly 256 bytes");
55 $biomePalette =
new PalettedBlockArray(ord($biomes2d[0]));
56 for($x = 0; $x < 16; ++$x){
57 for($z = 0; $z < 16; ++$z){
58 $biomeId = ord($biomes2d[($z << 4) | $x]);
59 for($y = 0; $y < 16; ++$y){
60 $biomePalette->set($x, $y, $z, $biomeId);