public interface Inventory2D extends OrderedInventory
Modifier and Type | Method and Description |
---|---|
Optional<Slot> |
getSlot(SlotPos pos)
Get the
Slot at the specified position. |
Optional<ItemStack> |
peek(SlotPos pos)
Get without removing the stack at the supplied position in this
Inventory.
|
Optional<ItemStack> |
peek(SlotPos pos,
int limit)
Get without removing the stack at the supplied position in this
Inventory.
|
Optional<ItemStack> |
poll(SlotPos pos)
Get and remove the stack at the supplied position in this Inventory.
|
Optional<ItemStack> |
poll(SlotPos pos,
int limit)
Get and remove the stack at the supplied position in this Inventory.
|
InventoryOperationResult |
set(SlotPos pos,
ItemStack stack)
Set the item in the specified slot.
|
getSlot, peek, peek, poll, poll, set
capacity, clear, contains, contains, first, getMaxStackSize, getProperties, getProperties, getProperty, getProperty, isEmpty, next, offer, parent, peek, peek, poll, poll, query, query, query, query, query, query, query, set, setMaxStackSize, size, slots, totalItems
forEach, iterator, spliterator
Optional<ItemStack> poll(SlotPos pos)
pos
- Slot position to queryInventory.poll()
Inventory.poll()
Optional<ItemStack> poll(SlotPos pos, int limit)
pos
- Slot position to querylimit
- item limitInventory.poll()
Inventory.poll()
Optional<ItemStack> peek(SlotPos pos)
pos
- Slot position to queryInventory.peek()
Inventory.peek()
Optional<ItemStack> peek(SlotPos pos, int limit)
pos
- Slot position to querylimit
- item limitInventory.peek()
Inventory.peek()
InventoryOperationResult set(SlotPos pos, ItemStack stack)
pos
- Slot position to setstack
- Stack to insertInventory.set(org.spongepowered.api.item.inventory.ItemStack)
Inventory.set(ItemStack)
Optional<Slot> getSlot(SlotPos pos)
Slot
at the specified position.pos
- Slot position to retrieveOptional.empty()
if
no matching slot