Entity: fix chunk tracking consistency issues, fixed attempted chunk loading in origin world when teleporting to a different position in a different world

This commit is contained in:
Dylan K. Taylor
2020-12-10 18:13:18 +00:00
parent 5282ae3298
commit e925423749
4 changed files with 25 additions and 43 deletions

View File

@ -648,9 +648,9 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
}
}
protected function switchWorld(World $targetWorld) : bool{
protected function setPosition(Vector3 $pos) : bool{
$oldWorld = $this->location->isValid() ? $this->location->getWorld() : null;
if(parent::switchWorld($targetWorld)){
if(parent::setPosition($pos)){
if($oldWorld !== null){
foreach($this->usedChunks as $index => $status){
World::getXZ($index, $X, $Z);