Interface EquipmentInventory
-
- All Superinterfaces:
Inventory
,ValueContainer
public interface EquipmentInventory extends Inventory
Equipment inventory forEquipable
s that can carry equipment.
-
-
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 java.util.Optional<Equipable>
carrier()
Returns the holder of this Inventory.default java.util.Optional<ItemStack>
peek(java.util.function.Supplier<? extends EquipmentType> equipmentType)
java.util.Optional<ItemStack>
peek(EquipmentType equipmentType)
Gets without removing the stack for the specified equipment type in this Inventory.default InventoryTransactionResult.Poll
poll(java.util.function.Supplier<? extends EquipmentType> equipmentType)
default InventoryTransactionResult.Poll
poll(java.util.function.Supplier<? extends EquipmentType> equipmentType, int limit)
InventoryTransactionResult.Poll
poll(EquipmentType equipmentType)
Gets and remove the stack for the specified equipment type in this Inventory.InventoryTransactionResult.Poll
poll(EquipmentType equipmentType, int limit)
Gets and remove the items from the stack for the specified equipment type in this Inventory.default InventoryTransactionResult
set(java.util.function.Supplier<? extends EquipmentType> equipmentType, ItemStack stack)
InventoryTransactionResult
set(EquipmentType equipmentType, ItemStack stack)
Sets the item for the specified equipment type.default java.util.Optional<Slot>
slot(java.util.function.Supplier<? extends EquipmentType> equipmentType)
java.util.Optional<Slot>
slot(EquipmentType equipmentType)
Gets theSlot
for the specified equipment type.-
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
-
carrier
java.util.Optional<Equipable> carrier()
Returns the holder of this Inventory. It can be an entity, block, or other object.- Returns:
- This inventory's carrier
-
poll
InventoryTransactionResult.Poll poll(EquipmentType equipmentType)
Gets and remove the stack for the specified equipment type in this Inventory.- Parameters:
equipmentType
- Type of equipment slot to query for- Returns:
- removed ItemStack, per the semantics of
Inventory.poll()
- See Also:
Inventory.poll()
-
poll
default InventoryTransactionResult.Poll poll(java.util.function.Supplier<? extends EquipmentType> equipmentType)
-
poll
InventoryTransactionResult.Poll poll(EquipmentType equipmentType, int limit)
Gets and remove the items from the stack for the specified equipment type in this Inventory.- Parameters:
equipmentType
- Type of equipment slot to query forlimit
- item limit- Returns:
- removed ItemStack, per the semantics of
Inventory.poll()
- See Also:
Inventory.poll()
-
poll
default InventoryTransactionResult.Poll poll(java.util.function.Supplier<? extends EquipmentType> equipmentType, int limit)
-
peek
java.util.Optional<ItemStack> peek(EquipmentType equipmentType)
Gets without removing the stack for the specified equipment type in this Inventory.- Parameters:
equipmentType
- Type of equipment slot to query for- Returns:
- removed ItemStack, per the semantics of
Inventory.peek()
- See Also:
Inventory.peek()
-
peek
default java.util.Optional<ItemStack> peek(java.util.function.Supplier<? extends EquipmentType> equipmentType)
-
set
InventoryTransactionResult set(EquipmentType equipmentType, ItemStack stack)
Sets the item for the specified equipment type.- Parameters:
equipmentType
- Type of equipment slot to setstack
- stack to insert- Returns:
- operation result, for details see
Inventory.set(int, org.spongepowered.api.item.inventory.ItemStack)
- See Also:
Slot.set(ItemStack)
-
set
default InventoryTransactionResult set(java.util.function.Supplier<? extends EquipmentType> equipmentType, ItemStack stack)
-
slot
java.util.Optional<Slot> slot(EquipmentType equipmentType)
Gets theSlot
for the specified equipment type.- Parameters:
equipmentType
- Type of equipment slot to set- Returns:
- matching slot or
Optional.empty()
if no matching slot
-
slot
default java.util.Optional<Slot> slot(java.util.function.Supplier<? extends EquipmentType> equipmentType)
-
-