mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 16:59:44 +00:00
Fixed assert failure in SubChunk
This commit is contained in:
parent
a858103e6b
commit
7aa4c18afa
@ -138,11 +138,9 @@ class SubChunk implements SubChunkInterface{
|
||||
}
|
||||
|
||||
public function getHighestBlockAt(int $x, int $z) : int{
|
||||
$low = ($x << 8) | ($z << 4);
|
||||
$i = $low | 0x0f;
|
||||
for(; $i >= $low; --$i){
|
||||
if(($this->blockLayers[0]->get($x, $i, $z) >> 4) !== BlockIds::AIR){
|
||||
return $i & 0x0f;
|
||||
for($y = 15; $y >= 0; --$y){
|
||||
if(($this->blockLayers[0]->get($x, $y, $z) >> 4) !== BlockIds::AIR){
|
||||
return $y;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user