public function addEntity(Entity $entity) { $this->entities[$entity->getId()] = $entity; if (!$entity instanceof Player and $this->isInit) { $this->hasChanged = true; } }