mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 09:19:42 +00:00
fix crash in getHighestBlockAt()
This commit is contained in:
parent
18e16f8615
commit
85e1b77cae
@ -138,6 +138,9 @@ class SubChunk implements SubChunkInterface{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getHighestBlockAt(int $x, int $z) : int{
|
public function getHighestBlockAt(int $x, int $z) : int{
|
||||||
|
if(empty($this->blockLayers)){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
for($y = 15; $y >= 0; --$y){
|
for($y = 15; $y >= 0; --$y){
|
||||||
if(($this->blockLayers[0]->get($x, $y, $z) >> 4) !== BlockIds::AIR){
|
if(($this->blockLayers[0]->get($x, $y, $z) >> 4) !== BlockIds::AIR){
|
||||||
return $y;
|
return $y;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user