public interface OrderedInventory extends Inventory
Slot
s in some pre-determined order with
indices between 0 and 1-Inventory.capacity()
.Modifier and Type | Method and Description |
---|---|
Optional<Slot> |
getSlot(SlotIndex index)
Get the
Slot at the specified position. |
Optional<ItemStack> |
peek(SlotIndex index)
Get without removing the stack at the supplied index in this Inventory.
|
Optional<ItemStack> |
peek(SlotIndex index,
int limit)
Get without removing the stack at the supplied index in this Inventory.
|
Optional<ItemStack> |
poll(SlotIndex index)
Get and remove the stack at the supplied index in this Inventory.
|
Optional<ItemStack> |
poll(SlotIndex index,
int limit)
Get and remove the stack at the supplied index in this Inventory.
|
InventoryOperationResult |
set(SlotIndex index,
ItemStack stack)
Set the item in the specified slot.
|
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(SlotIndex index)
index
- slot index to queryInventory.poll()
Inventory.poll()
Optional<ItemStack> poll(SlotIndex index, int limit)
index
- slot index to querylimit
- item limitInventory.poll()
Inventory.poll()
Optional<ItemStack> peek(SlotIndex index)
index
- slot index to queryInventory.peek()
Inventory.peek()
Optional<ItemStack> peek(SlotIndex index, int limit)
index
- slot index to querylimit
- item limitInventory.peek()
Inventory.peek()
InventoryOperationResult set(SlotIndex index, ItemStack stack)
index
- Slot index to setstack
- Stack to insertInventory.set(org.spongepowered.api.item.inventory.ItemStack)
Inventory.set(ItemStack)
Optional<Slot> getSlot(SlotIndex index)
Slot
at the specified position.index
- Slot index to retrieveOptional.empty()
if
no matching slot