mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 09:19:42 +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{
|
public function getHighestBlockAt(int $x, int $z) : int{
|
||||||
$low = ($x << 8) | ($z << 4);
|
for($y = 15; $y >= 0; --$y){
|
||||||
$i = $low | 0x0f;
|
if(($this->blockLayers[0]->get($x, $y, $z) >> 4) !== BlockIds::AIR){
|
||||||
for(; $i >= $low; --$i){
|
return $y;
|
||||||
if(($this->blockLayers[0]->get($x, $i, $z) >> 4) !== BlockIds::AIR){
|
|
||||||
return $i & 0x0f;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user