pocketmine\tile\Chest::close PHP Méthode

close() public méthode

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

Usage Example

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