mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Make use of isInLoadedTerrain()
This commit is contained in:
@ -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){
|
||||
|
Reference in New Issue
Block a user