mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Entity: Move responsibility of checking for despawn to Level
this ensures that flagging for despawn will always work as intended, including when onUpdate() is overridden.
This commit is contained in:
@ -745,6 +745,9 @@ class Level implements ChunkManager, Metadatable{
|
||||
if($entity->isClosed() or !$entity->onUpdate($currentTick)){
|
||||
unset($this->updateEntities[$id]);
|
||||
}
|
||||
if($entity->isFlaggedForDespawn()){
|
||||
$entity->close();
|
||||
}
|
||||
}
|
||||
Timings::$tickEntityTimer->stopTiming();
|
||||
$this->timings->entityTick->stopTiming();
|
||||
|
Reference in New Issue
Block a user