Added API method Entity->isClosed() and made Entity->closed protected

This commit is contained in:
Dylan K. Taylor
2017-08-16 19:30:23 +01:00
parent 20aa519f3a
commit eebc52e00b
7 changed files with 21 additions and 8 deletions

View File

@ -722,7 +722,7 @@ class Level implements ChunkManager, Metadatable{
//Update entities that need update
Timings::$tickEntityTimer->startTiming();
foreach($this->updateEntities as $id => $entity){
if($entity->closed or !$entity->onUpdate($currentTick)){
if($entity->isClosed() or !$entity->onUpdate($currentTick)){
unset($this->updateEntities[$id]);
}
}