mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Despawn entities correctly from clients as they move
This commit is contained in:
parent
bf596ebf05
commit
f8f1e0e9df
@ -531,9 +531,9 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
}
|
||||
}
|
||||
|
||||
$this->level->freeChunk($x, $z, $this);
|
||||
unset($this->usedChunks[$index]);
|
||||
}
|
||||
$this->level->freeChunk($x, $z, $this);
|
||||
unset($this->loadQueue[$index]);
|
||||
}
|
||||
|
||||
@ -724,13 +724,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
$X = null;
|
||||
$Z = null;
|
||||
Level::getXZ($index, $X, $Z);
|
||||
foreach($this->level->getChunkEntities($X, $Z) as $entity){
|
||||
if($entity !== $this){
|
||||
$entity->despawnFrom($this);
|
||||
}
|
||||
}
|
||||
|
||||
unset($this->usedChunks[$index]);
|
||||
$this->unloadChunk($X, $Z);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user