mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 11:57:10 +00:00
Improved level switching for players
This commit is contained in:
parent
f8f1e0e9df
commit
4d97827d44
@ -745,14 +745,11 @@ abstract class Entity extends Location implements Metadatable{
|
||||
$X = null;
|
||||
$Z = null;
|
||||
Level::getXZ($index, $X, $Z);
|
||||
foreach($this->level->getChunkEntities($X, $Z) as $entity){
|
||||
$entity->despawnFrom($this);
|
||||
}
|
||||
$this->level->freeChunk($X, $Z, $this);
|
||||
$this->unloadChunk($X, $Z);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->setLevel($targetLevel, $this instanceof Player ? true : false); //Hard reference
|
||||
$this->setLevel($targetLevel);
|
||||
$this->level->addEntity($this);
|
||||
if($this instanceof Player){
|
||||
$this->usedChunks = [];
|
||||
|
Loading…
x
Reference in New Issue
Block a user