InventoryAccess
classInventory interface with add and remove operations
Fields
| Name | Type | Description | |
|---|---|---|---|
| zero_slots | boolean | Keeps a slot whose count drops to zero | |
| draggable | boolean | Whether inventory can be dragged in UI (default: true) | |
| drop_on_break | boolean | Whether what it holds goes to the player when the block is broken or replaced (default: true); false for a slot that only shows something | |
Functions
InventoryAccess:add(item, count)
Add item with count to InventoryAccess
| item | StaticItem | |
| count | integer |
returns integer Remainder
InventoryAccess:sub(item, count)
Remove item with count from InventoryAccess
| item | StaticItem | |
| count | integer |
returns integer Remainder
InventoryAccess:add_at(index, item, count)
Add item with count into one slot
| index | integer | Slot index from 0, as get takes it |
| item | StaticItem | |
| count | integer |
returns integer Remainder, all of count when there is no such slot
InventoryAccess:sub_at(index, item, count)
Remove item with count from one slot
| index | integer | Slot index from 0, as get takes it |
| item | StaticItem | |
| count | integer |
returns integer Remainder, all of count when there is no such slot or it holds another item
Standard members (2)
These members are available on all classes of this kind.
| InventoryAccess.cast(object) | Trying to cast Object into InventoryAccess |
| InventoryAccess.get_class() | Return InventoryAccess class object |
Inherited from InventoryReader (3)
- size read-only Number of slots in this InventoryReader
- InventoryReader:get(index) Get ItemData with index from InventoryReader
- InventoryReader:find(item) Looking for index of StaticItem in InventoryReader
Inherited from Instance (1)
- Instance:is_valid() Returns false once the underlying engine object has been destroyed
Inherited from Object (3)
- name read-only Object name
- Object.find(name) Find an already loaded object by name
- Object:get_class() Class of this object
Subclasses
Used by
- BaseInventoryAccessor.input field
- BaseInventoryAccessor.output field
- InventoryContainer.get_access return
- InventoryContainer.bind param
- InventoryInventoryFilter.inventory field
- StorageBlockLogic.storage_access field
- ui.Inventory.inventory field