transaction = $transaction; $this->recipe = $recipe; $this->repetitions = $repetitions; $this->inputs = $inputs; $this->outputs = $outputs; } /** * Returns the inventory transaction involved in this crafting event. */ public function getTransaction() : CraftingTransaction{ return $this->transaction; } /** * Returns the recipe crafted. */ public function getRecipe() : CraftingRecipe{ return $this->recipe; } /** * Returns the number of times the recipe was crafted. This is usually 1, but might be more in the case of recipe * book shift-clicks (which craft lots of items in a batch). */ public function getRepetitions() : int{ return $this->repetitions; } /** * Returns a list of items destroyed as ingredients of the recipe. * * @return Item[] */ public function getInputs() : array{ return $this->inputs; } /** * Returns a list of items created by crafting the recipe. * * @return Item[] */ public function getOutputs() : array{ return $this->outputs; } public function getPlayer() : Player{ return $this->transaction->getSource(); } }