Fix heightmap crashes at the corner of chunks

Stupid unpack() return array indices start at 1, not 0 >_<
This commit is contained in:
Dylan K. Taylor 2017-02-20 10:28:43 +00:00
parent 20c7e51077
commit 2ff565afe5

View File

@ -181,7 +181,7 @@ class McRegion extends BaseLevelProvider{
$heightMap = [];
if(isset($chunk->HeightMap)){
if($chunk->HeightMap instanceof ByteArrayTag){
$heightMap = unpack("C*", $chunk->HeightMap->getValue());
$heightMap = array_values(unpack("C*", $chunk->HeightMap->getValue()));
}elseif($chunk->HeightMap instanceof IntArrayTag){
$heightMap = $chunk->HeightMap->getValue(); #blameshoghicp
}