mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 02:38:54 +00:00
Return on Level->getSafeSpawn() in case of invalid position
This commit is contained in:
parent
ea44eee5df
commit
9886eb4768
@ -2139,7 +2139,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(; $v->y < 128; ++$v->y){
|
for(; $v->y >= 0 and $v->y < 128; ++$v->y){
|
||||||
if(!Block::$solid[$chunk->getBlockId($x, $v->y + 1, $z)]){
|
if(!Block::$solid[$chunk->getBlockId($x, $v->y + 1, $z)]){
|
||||||
if(!Block::$solid[$chunk->getBlockId($x, $v->y, $z)]){
|
if(!Block::$solid[$chunk->getBlockId($x, $v->y, $z)]){
|
||||||
return new Position($spawn->x, $v->y === Math::floorFloat($spawn->y) ? $spawn->y : $v->y, $spawn->z, $this);
|
return new Position($spawn->x, $v->y === Math::floorFloat($spawn->y) ? $spawn->y : $v->y, $spawn->z, $this);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user