Interface EquipmentInventory
- All Superinterfaces:
Inventory
,ValueContainer
Equipment inventory for
Equipable
s that can carry equipment.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.spongepowered.api.item.inventory.Inventory
Inventory.Builder
-
Method Summary
Modifier and TypeMethodDescriptioncarrier()
Returns the holder of this Inventory.peek
(Supplier<? extends EquipmentType> equipmentType) peek
(EquipmentType equipmentType) Gets without removing the stack for the specified equipment type in this Inventory.default InventoryTransactionResult.Poll
poll
(Supplier<? extends EquipmentType> equipmentType) default InventoryTransactionResult.Poll
poll
(Supplier<? extends EquipmentType> equipmentType, int limit) poll
(EquipmentType equipmentType) Gets and remove the stack for the specified equipment type in this Inventory.poll
(EquipmentType equipmentType, int limit) Gets and remove the items from the stack for the specified equipment type in this Inventory.default InventoryTransactionResult
set
(Supplier<? extends EquipmentType> equipmentType, ItemStack stack) set
(EquipmentType equipmentType, ItemStack stack) Sets the item for the specified equipment type.slot
(Supplier<? extends EquipmentType> equipmentType) 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 Details
-
carrier
Returns the holder of this Inventory. It can be an entity, block, or other object.- Returns:
- This inventory's carrier
-
poll
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:
-
poll
-
poll
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:
-
poll
default InventoryTransactionResult.Poll poll(Supplier<? extends EquipmentType> equipmentType, int limit) -
peek
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:
-
peek
-
set
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:
-
set
default InventoryTransactionResult set(Supplier<? extends EquipmentType> equipmentType, ItemStack stack) -
slot
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
-