public interface OrderedInventory extends Inventory
Slots in some pre-determined order with
indices between 0 and 1-Inventory.capacity().Inventory.Builder| Modifier and Type | Method and Description |
|---|---|
Optional<Slot> |
getSlot(SlotIndex index)
Gets the
Slot at the specified position. |
Optional<ItemStack> |
peek(SlotIndex index)
Gets without removing the stack at the supplied index in this Inventory.
|
Optional<ItemStack> |
peek(SlotIndex index,
int limit)
Gets without removing the stack at the supplied index in this Inventory.
|
Optional<ItemStack> |
poll(SlotIndex index)
Gets and remove the stack at the supplied index in this Inventory.
|
Optional<ItemStack> |
poll(SlotIndex index,
int limit)
Gets and remove the stack at the supplied index in this Inventory.
|
InventoryTransactionResult |
set(SlotIndex index,
ItemStack stack)
Sets the item in the specified slot.
|
builder, canFit, capacity, clear, contains, contains, containsAny, containsInventory, first, getArchetype, getInventoryProperty, getInventoryProperty, getMaxStackSize, getPlugin, getProperties, getProperties, getProperty, getProperty, hasChildren, intersect, next, offer, parent, peek, peek, poll, poll, query, query, query, query, query, query, query, queryAny, root, set, setMaxStackSize, size, slots, totalItems, transform, unionforEach, iterator, spliteratorOptional<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()InventoryTransactionResult 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