Make use of isInLoadedTerrain()

This commit is contained in:
Dylan K. Taylor
2018-10-20 19:13:34 +01:00
parent 8ac1b18b17
commit 2a40c0d82c
2 changed files with 5 additions and 9 deletions

View File

@ -1541,14 +1541,9 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
$this->server->getLogger()->warning($this->getName() . " moved too fast, reverting movement");
$this->server->getLogger()->debug("Old position: " . $this->asVector3() . ", new position: " . $this->newPosition);
$revert = true;
}else{
$chunkX = $newPos->getFloorX() >> 4;
$chunkZ = $newPos->getFloorZ() >> 4;
if(!$this->level->isChunkLoaded($chunkX, $chunkZ) or !$this->level->isChunkGenerated($chunkX, $chunkZ)){
$revert = true;
$this->nextChunkOrderRun = 0;
}
}elseif(!$this->level->isInLoadedTerrain($newPos) or !$this->level->isChunkGenerated($newPos->getFloorX() >> 4, $newPos->getFloorZ() >> 4)){
$revert = true;
$this->nextChunkOrderRun = 0;
}
if(!$revert and $distanceSquared != 0){