public function close() { if ($this->closed === false) { foreach ($this->getInventory()->getViewers() as $player) { $player->removeWindow($this->getInventory()); } parent::close(); } }