public function onClose(Player $who) { $pk = new ContainerClosePacket(); $pk->windowid = $who->getWindowId($this); $who->dataPacket($pk); parent::onClose($who); }
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); } }