CraftingTransaction: Don't hardcode crafting grid sizes

This commit is contained in:
Dylan K. Taylor
2017-11-28 17:13:23 +00:00
parent 98ac6fc7be
commit 878f1bffb9
3 changed files with 8 additions and 4 deletions

View File

@ -46,7 +46,7 @@ class CraftingTransaction extends InventoryTransaction{
protected $recipe = null;
public function __construct(Player $source, $actions = []){
$this->gridSize = ($source->getCraftingGrid() instanceof BigCraftingGrid) ? 3 : 2;
$this->gridSize = $source->getCraftingGrid()->getGridWidth();
$air = ItemFactory::get(Item::AIR, 0, 0);
$this->inputs = array_fill(0, $this->gridSize, array_fill(0, $this->gridSize, $air));