mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
CraftingRecipe: added methods to allow recipes to derive outputs from inputs
this will be needed for special recipes like shulker-box and banner recipes.
This commit is contained in:
@ -121,7 +121,7 @@ class CraftingTransaction extends InventoryTransaction{
|
||||
}
|
||||
|
||||
try{
|
||||
$this->repetitions = $this->matchRecipeItems($this->outputs, $this->recipe->getResults(), false);
|
||||
$this->repetitions = $this->matchRecipeItems($this->outputs, $this->recipe->getResultsFor($this->source->getCraftingGrid()), false);
|
||||
|
||||
if(($inputIterations = $this->matchRecipeItems($this->inputs, $this->recipe->getIngredientList(), true)) !== $this->repetitions){
|
||||
throw new \InvalidStateException("Tried to craft recipe $this->repetitions times in batch, but have enough inputs for $inputIterations");
|
||||
|
Reference in New Issue
Block a user