pocketmine\tile\Chest::close PHP Method

close() public method

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

Example #1
0
 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();
     }
 }