diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index 79a718900..1b290908f 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -2709,9 +2709,7 @@ class Level implements ChunkManager, Metadatable{ $y = (int) min($max - 2, $v->y); $wasAir = ($chunk->getBlockId($x, $y - 1, $z) === 0); for(; $y > 0; --$y){ - $b = $chunk->getFullBlock($x, $y, $z); - $block = BlockFactory::get($b >> 4, $b & 0x0f); - if($this->isFullBlock($block)){ + if($this->isFullBlock($this->getBlockAt($x, $y, $z))){ if($wasAir){ $y++; break; @@ -2722,12 +2720,8 @@ class Level implements ChunkManager, Metadatable{ } for(; $y >= 0 and $y < $max; ++$y){ - $b = $chunk->getFullBlock($x, $y + 1, $z); - $block = BlockFactory::get($b >> 4, $b & 0x0f); - if(!$this->isFullBlock($block)){ - $b = $chunk->getFullBlock($x, $y, $z); - $block = BlockFactory::get($b >> 4, $b & 0x0f); - if(!$this->isFullBlock($block)){ + if(!$this->isFullBlock($this->getBlockAt($x, $y + 1, $z))){ + if(!$this->isFullBlock($this->getBlockAt($x, $y, $z))){ return new Position($spawn->x, $y === (int) $spawn->y ? $spawn->y : $y, $spawn->z, $this); } }else{