fix crash in getHighestBlockAt()

This commit is contained in:
Dylan K. Taylor 2019-03-05 04:14:28 -05:00
parent 18e16f8615
commit 85e1b77cae

View File

@ -138,6 +138,9 @@ class SubChunk implements SubChunkInterface{
}
public function getHighestBlockAt(int $x, int $z) : int{
if(empty($this->blockLayers)){
return -1;
}
for($y = 15; $y >= 0; --$y){
if(($this->blockLayers[0]->get($x, $y, $z) >> 4) !== BlockIds::AIR){
return $y;