mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Fixed Level->getSafeSpawn() looking for blocks in chunk 0,0
This commit is contained in:
@ -2703,11 +2703,11 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
$max = $this->provider->getWorldHeight();
|
$max = $this->provider->getWorldHeight();
|
||||||
$v = $spawn->floor();
|
$v = $spawn->floor();
|
||||||
$chunk = $this->getChunk($v->x >> 4, $v->z >> 4, false);
|
$chunk = $this->getChunk($v->x >> 4, $v->z >> 4, false);
|
||||||
$x = $v->x & 0x0f;
|
$x = (int) $v->x;
|
||||||
$z = $v->z & 0x0f;
|
$z = (int) $v->z;
|
||||||
if($chunk !== null){
|
if($chunk !== null){
|
||||||
$y = (int) min($max - 2, $v->y);
|
$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){
|
for(; $y > 0; --$y){
|
||||||
if($this->isFullBlock($this->getBlockAt($x, $y, $z))){
|
if($this->isFullBlock($this->getBlockAt($x, $y, $z))){
|
||||||
if($wasAir){
|
if($wasAir){
|
||||||
|
Reference in New Issue
Block a user