public function __construct(Player $p) { parent::__construct($p, InventoryType::get(2)); $inv = $p->getInventory(); $this->setContents($inv->getContents()); $this->armor = $inv->getArmorContents(); for ($i = 0; $i < 10; $i++) { $this->hotbar[$i] = $inv->getHotbarSlotIndex($i); } }
public function onClose(Player $who) { if (count($this->getViewers()) === 1) { $pk = new TileEventPacket(); $pk->x = $this->main->getFakeTile()->x; $pk->y = $this->main->getFakeTile()->y; $pk->z = $this->main->getFakeTile()->z; $pk->case1 = 1; $pk->case2 = 0; if (($level = $this->main->getFakeTile()->getLevel()) instanceof Level) { Server::broadcastPacket($level->getChunkPlayers($this->main->getFakeTile()->x >> 4, $this->main->getFakeTile()->z >> 4), $pk->setChannel(Network::CHANNEL_WORLD_EVENTS)); } } parent::onClose($who); }
public function __construct($holder, $client) { $this->client = $client; parent::__construct($holder, InventoryType::get(InventoryType::CHEST), [], null, "Trader Inventory"); }
public function __construct(InventoryHolder $holder, $name = "Money Account") { parent::__construct($holder, clone InventoryType::get(InventoryType::CHEST), [], 36, $name); }