onClose() public method

public onClose ( Player $who )
$who pocketmine\Player
コード例 #1
0
ファイル: AnvilInventory.php プロジェクト: iTXTech/Genisys
 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
ファイル: EnchantInventory.php プロジェクト: iTXTech/Genisys
 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;
     }
 }