mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 00:39:45 +00:00
World: fixed a crash in getFullBlock() when used on ungenerated terrain
This commit is contained in:
parent
f5807ac049
commit
5701e733cc
@ -1295,7 +1295,10 @@ class World implements ChunkManager{
|
|||||||
* @return int bitmap, (id << 4) | data
|
* @return int bitmap, (id << 4) | data
|
||||||
*/
|
*/
|
||||||
public function getFullBlock(int $x, int $y, int $z) : int{
|
public function getFullBlock(int $x, int $y, int $z) : int{
|
||||||
return $this->getOrLoadChunk($x >> 4, $z >> 4, false)->getFullBlock($x & 0x0f, $y, $z & 0x0f);
|
if(($chunk = $this->getOrLoadChunk($x >> 4, $z >> 4, false)) !== null){
|
||||||
|
return $chunk->getFullBlock($x & 0x0f, $y, $z & 0x0f);
|
||||||
|
}
|
||||||
|
return BlockLegacyIds::AIR << 4; //TODO: this should throw (ungenerated chunk)
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isInWorld(int $x, int $y, int $z) : bool{
|
public function isInWorld(int $x, int $y, int $z) : bool{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user