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); } }
public function onClose(Player $who) { $who->updateExperience(); parent::onClose($who); $this->getHolder()->getLevel()->dropItem($this->getHolder()->add(0.5, 0.5, 0.5), $this->getItem(1)); $this->getHolder()->getLevel()->dropItem($this->getHolder()->add(0.5, 0.5, 0.5), $this->getItem(0)); $this->clear(0); $this->clear(1); $this->clear(2); }
public function onClose(Player $who) { if (count($this->getViewers()) === 1) { $pk = new BlockEventPacket(); $pk->x = $this->getHolder()->getX(); $pk->y = $this->getHolder()->getY(); $pk->z = $this->getHolder()->getZ(); $pk->case1 = 1; $pk->case2 = 0; if (($level = $this->getHolder()->getLevel()) instanceof Level) { $level->addChunkPacket($this->getHolder()->getX() >> 4, $this->getHolder()->getZ() >> 4, $pk); } } parent::onClose($who); }