mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +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]);
|
unset($this->usedChunks[$index]);
|
||||||
}
|
}
|
||||||
|
$this->level->freeChunk($x, $z, $this);
|
||||||
unset($this->loadQueue[$index]);
|
unset($this->loadQueue[$index]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -724,13 +724,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
$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);
|
||||||
if($entity !== $this){
|
|
||||||
$entity->despawnFrom($this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unset($this->usedChunks[$index]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user