Inheritance: extends ContainerInventory
示例#1
0
 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);
 }
示例#2
0
 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);
 }
示例#3
0
 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;
     }
 }