mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Fixed Level->getSafeSpawn() looking for blocks in chunk 0,0
This commit is contained in:
parent
bee3c4f5cd
commit
12bbc764ec
@ -2703,11 +2703,11 @@ class Level implements ChunkManager, Metadatable{
|
||||
$max = $this->provider->getWorldHeight();
|
||||
$v = $spawn->floor();
|
||||
$chunk = $this->getChunk($v->x >> 4, $v->z >> 4, false);
|
||||
$x = $v->x & 0x0f;
|
||||
$z = $v->z & 0x0f;
|
||||
$x = (int) $v->x;
|
||||
$z = (int) $v->z;
|
||||
if($chunk !== null){
|
||||
$y = (int) min($max - 2, $v->y);
|
||||
$wasAir = ($chunk->getBlockId($x, $y - 1, $z) === 0);
|
||||
$wasAir = ($chunk->getBlockId($x & 0x0f, $y - 1, $z & 0x0f) === 0);
|
||||
for(; $y > 0; --$y){
|
||||
if($this->isFullBlock($this->getBlockAt($x, $y, $z))){
|
||||
if($wasAir){
|
||||
|
Loading…
x
Reference in New Issue
Block a user