mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +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;
|
$X = null;
|
||||||
$Z = null;
|
$Z = null;
|
||||||
Level::getXZ($index, $X, $Z);
|
Level::getXZ($index, $X, $Z);
|
||||||
foreach($this->level->getChunkEntities($X, $Z) as $entity){
|
$this->unloadChunk($X, $Z);
|
||||||
$entity->despawnFrom($this);
|
|
||||||
}
|
|
||||||
$this->level->freeChunk($X, $Z, $this);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->setLevel($targetLevel, $this instanceof Player ? true : false); //Hard reference
|
$this->setLevel($targetLevel);
|
||||||
$this->level->addEntity($this);
|
$this->level->addEntity($this);
|
||||||
if($this instanceof Player){
|
if($this instanceof Player){
|
||||||
$this->usedChunks = [];
|
$this->usedChunks = [];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user