Esempio n. 1
0
 /**
  * @param InventoryHolder $holder
  * @param Inventory       $resultInventory
  * @param InventoryType   $inventoryType
  *
  * @throws \Throwable
  */
 public function __construct(InventoryHolder $holder, Inventory $resultInventory, InventoryType $inventoryType)
 {
     if ($inventoryType->getDefaultTitle() !== "Crafting") {
         throw new \InvalidStateException("Invalid Inventory type, expected CRAFTING or WORKBENCH");
     }
     $this->resultInventory = $resultInventory;
     parent::__construct($holder, $inventoryType);
 }
Esempio n. 2
0
 /**
  * @param InventoryHolder $holder
  * @param InventoryType   $inventoryType
  */
 public function __construct(InventoryHolder $holder)
 {
     parent::__construct($holder, InventoryType::get(InventoryType::PLAYER_FLOATING));
 }