public function onClose(Player $who) { parent::onClose($who); $this->getHolder()->getLevel()->dropItem($this->getHolder()->add(0.5, 0.5, 0.5), $this->getItem(0)); $this->getHolder()->getLevel()->dropItem($this->getHolder()->add(0.5, 0.5, 0.5), $this->getItem(1)); $this->clear(0); $this->clear(1); $this->clear(2); }
public function onClose(Player $who) { $who->recalculateXpProgress(); parent::onClose($who); $this->getHolder()->getLevel()->dropItem($this->getHolder()->add(0.5, 0.5, 0.5), $this->getItem(0)); $this->getHolder()->getLevel()->dropItem($this->getHolder()->add(0.5, 0.5, 0.5), $this->getItem(1)); $this->clear(0); $this->clear(1); $this->clear(2); }
public function onClose(Player $who) { parent::onClose($who); $level = $this->getHolder()->getLevel(); for ($i = 0; $i < 2; ++$i) { if ($level instanceof Level) { $level->dropItem($this->getHolder()->add(0.5, 0.5, 0.5), $this->getItem($i)); } $this->clear($i); } if (count($this->getViewers()) === 0) { $this->levels = null; $this->entries = null; $this->bookshelfAmount = 0; } }