mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 14:35:35 +00:00
parent
2ba47a80a4
commit
e762b79aae
@ -651,16 +651,19 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
|||||||
protected function setPosition(Vector3 $pos) : bool{
|
protected function setPosition(Vector3 $pos) : bool{
|
||||||
$oldWorld = $this->location->isValid() ? $this->location->getWorld() : null;
|
$oldWorld = $this->location->isValid() ? $this->location->getWorld() : null;
|
||||||
if(parent::setPosition($pos)){
|
if(parent::setPosition($pos)){
|
||||||
if($oldWorld !== null){
|
$newWorld = $this->getWorld();
|
||||||
foreach($this->usedChunks as $index => $status){
|
if($oldWorld !== $newWorld){
|
||||||
World::getXZ($index, $X, $Z);
|
if($oldWorld !== null){
|
||||||
$this->unloadChunk($X, $Z, $oldWorld);
|
foreach($this->usedChunks as $index => $status){
|
||||||
|
World::getXZ($index, $X, $Z);
|
||||||
|
$this->unloadChunk($X, $Z, $oldWorld);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$this->usedChunks = [];
|
$this->usedChunks = [];
|
||||||
$this->loadQueue = [];
|
$this->loadQueue = [];
|
||||||
$this->networkSession->onEnterWorld();
|
$this->networkSession->onEnterWorld();
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user