Interface CraftingInventory
- All Superinterfaces:
Inventory
,ValueContainer
A CraftingInventory represents the inventory of something that can craft
items.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.spongepowered.api.item.inventory.Inventory
Inventory.Builder
-
Method Summary
Modifier and TypeMethodDescriptionGets the crafting matrix of this CraftingInventory.default Optional
<CraftingRecipe> recipe
(ServerWorld world) Retrieves the recipe formed by this CraftingInventory, if any.result()
Gets the result slot of this CraftingInventory.Methods inherited from interface org.spongepowered.api.item.inventory.Inventory
asViewable, canFit, capacity, children, clear, contains, contains, containsAny, containsChild, containsInventory, freeCapacity, get, get, hasChildren, intersect, offer, offer, parent, peek, peekAt, poll, poll, pollFrom, pollFrom, query, query, query, query, query, query, root, set, slot, slots, totalQuantity, union
-
Method Details
-
craftingGrid
CraftingGridInventory craftingGrid()Gets the crafting matrix of this CraftingInventory.- Returns:
- The crafting matrix
-
result
CraftingOutput result()Gets the result slot of this CraftingInventory.- Returns:
- The result slot
-
recipe
Retrieves the recipe formed by this CraftingInventory, if any.- Parameters:
world
- The world where the item would be crafted in- Returns:
- The recipe or
Optional.empty()
if no recipe is formed
-