Interface Inventory2D
- All Superinterfaces:
Inventory
,ValueContainer
- All Known Subinterfaces:
GridInventory
,Hotbar
,InventoryColumn
,InventoryRow
Base interface for inventories with slots obtainable via SlotPos queries.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.spongepowered.api.item.inventory.Inventory
Inventory.Builder
-
Method Summary
Modifier and TypeMethodDescriptionGets without removing the stack at the supplied position in this Inventory.default InventoryTransactionResult.Poll
Gets and remove the stack at the supplied position in this Inventory.default InventoryTransactionResult.Poll
Gets and remove the stack at the supplied position in this Inventory.default InventoryTransactionResult
Sets the item in the specified slot.Gets theSlot
at the specified position.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
-
poll
Gets and remove the stack at the supplied position in this Inventory.- Parameters:
pos
- Slot position to query- Returns:
- matching stacks, as per the semantics of
Inventory.poll()
- See Also:
-
poll
Gets and remove the stack at the supplied position in this Inventory.- Parameters:
pos
- Slot position to querylimit
- item limit- Returns:
- matching stacks, as per the semantics of
Inventory.poll()
- See Also:
-
peek
Gets without removing the stack at the supplied position in this Inventory.- Parameters:
pos
- Slot position to query- Returns:
- matching stacks, as per the semantics of
Inventory.peek()
- See Also:
-
set
Sets the item in the specified slot.- Parameters:
pos
- Slot position to setstack
- Stack to insert- Returns:
- matching stacks, as per the semantics of
Inventory.set(int, org.spongepowered.api.item.inventory.ItemStack)
- See Also:
-
slot
Gets theSlot
at the specified position.- Parameters:
pos
- Slot position to retrieve- Returns:
- slot at the specified position, or
Optional.empty()
if no matching slot
-