Interface CraftingInventory
-
- All Superinterfaces:
Inventory
,ValueContainer
public interface CraftingInventory extends Inventory
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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description CraftingGridInventory
craftingGrid()
Gets the crafting matrix of this CraftingInventory.default java.util.Optional<CraftingRecipe>
recipe(ServerWorld world)
Retrieves the recipe formed by this CraftingInventory, if any.CraftingOutput
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 Detail
-
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
default java.util.Optional<CraftingRecipe> recipe(ServerWorld world)
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
-
-