Interface CraftingMatch
A recipe that matches a crafting grid: what one craft gives, and what it takes from each slot.
Instances are immutable.
- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptionintconsumed(int slot) static CraftingMatchof(CraftingRecipe recipe, ItemStack result, int[] consumed) What aCraftingRecipewritten by a plugin returns fromCraftingRecipe.match(CraftingInput, ItemTagLookup).recipe()result()withResult(ItemStack newResult)
-
Method Details
-
of
What aCraftingRecipewritten by a plugin returns fromCraftingRecipe.match(CraftingInput, ItemTagLookup).- Parameters:
recipe- the recipe that matchedresult- what one craft gives, not emptyconsumed- how many items one craft takes from each slot of the input, row-major- Returns:
- the match
- Throws:
IllegalArgumentException- ifresultis empty or a count is negative- Since:
- 0.1.0
-
recipe
CraftingRecipe recipe()- Returns:
- the recipe that matched
- Since:
- 0.1.0
-
result
ItemStack result()- Returns:
- what one craft gives
- Since:
- 0.1.0
-
consumed
int consumed(int slot) - Parameters:
slot- the slot index of the input, row-major- Returns:
- how many items one craft takes from that slot,
0outside the grid - Since:
- 0.1.0
-
withResult
- Parameters:
newResult- what one craft gives instead- Returns:
- a match taking the same items but giving
newResult - Since:
- 0.1.0
-