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

@ -611,7 +611,7 @@ class Chunk{
* @param Entity $entity
*/
public function addEntity(Entity $entity){
if($entity->closed){
if($entity->isClosed()){
throw new \InvalidArgumentException("Attempted to add a garbage closed Entity to a chunk");
}
$this->entities[$entity->getId()] = $entity;