public function __construct(Chest $left, Chest $right) { $this->left = $left->getRealInventory(); $this->right = $right->getRealInventory(); $items = array_merge($this->left->getContents(), $this->right->getContents()); BaseInventory::__construct($this, InventoryType::get(InventoryType::DOUBLE_CHEST), $items); }
/** * @param InventoryHolder $holder * @param InventoryType $type * @param Item[] $items * @param int $overrideSize * @param string $overrideTitle */ public function __construct(InventoryHolder $holder, InventoryType $type, array $items = [], $overrideSize = null, $overrideTitle = null) { $this->holder = $holder; $this->type = $type; if ($overrideSize !== null) { $this->size = (int) $overrideSize; } else { $this->size = $this->type->getDefaultSize(); } if ($overrideTitle !== null) { $this->title = $overrideTitle; } else { $this->title = $this->type->getDefaultTitle(); } $this->name = $this->type->getDefaultTitle(); $this->setContents($items); }
public function __construct(BrewingStand $tile) { parent::__construct($tile, InventoryType::get(InventoryType::BREWING_STAND)); }
public function __construct(Chest $tile) { parent::__construct($tile, InventoryType::get(InventoryType::CHEST)); }
public function __construct(Position $pos) { parent::__construct(new FakeBlockMenu($this, $pos), InventoryType::get(InventoryType::ENCHANT_TABLE)); }
public function __construct(Human $player) { $this->hotbar = array_fill(0, $this->getHotbarSize(), -1); parent::__construct($player, InventoryType::get(InventoryType::PLAYER)); }
public function __construct(Furnace $tile) { parent::__construct($tile, InventoryType::get(InventoryType::FURNACE)); }