mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
generalized conditions for saving entities with chunks
This commit is contained in:
@ -667,6 +667,13 @@ class Chunk{
|
||||
return $this->entities;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Entity[]
|
||||
*/
|
||||
public function getSavableEntities() : array{
|
||||
return array_filter($this->entities, function(Entity $entity) : bool{ return $entity->canSaveWithChunk() and !$entity->isClosed(); });
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Tile[]
|
||||
*/
|
||||
|
Reference in New Issue
Block a user