pocketmine\inventory\ContainerInventory::onClose PHP Méthode

onClose() public méthode

public onClose ( Player $who )
$who pocketmine\Player
    public function onClose(Player $who)
    {
        $pk = new ContainerClosePacket();
        $pk->windowid = $who->getWindowId($this);
        $who->dataPacket($pk);
        parent::onClose($who);
    }

Usage Example

 public function onClose(Player $who)
 {
     parent::onClose($who);
     for ($i = 0; $i < 2; ++$i) {
         $this->getHolder()->getLevel()->dropItem($this->getHolder()->add(0.5, 0.5, 0.5), $this->getItem($i));
         $this->clear($i);
     }
 }
All Usage Examples Of pocketmine\inventory\ContainerInventory::onClose
ContainerInventory