|clear()||Make this inventory empty.|
|can_insert(items) → boolean||Can at least some items be inserted?|
|insert(items) → uint||Insert items into this inventory.|
|remove(items) → uint||Remove items from this inventory.|
|get_item_count(item) → uint||Get the number of all or some items in this inventory.|
|is_empty() → boolean||Does this inventory contain nothing?|
|get_contents() → dictionary string → uint||Get counts of all items in this inventory.|
|hasbar() → boolean||Does this inventory have a bar?|
|getbar() → uint||Get the current bar.|
|setbar(bar)||Set the current bar.|
|valid :: boolean [R]||Is this object valid?|
|operator  [RW]||The indexing operator.|
|operator # [R]||Get the number of slots in this inventory.|
A storage of item stacks.
Make this inventory empty.
Can at least some items be inserted?
trueif at least a part of the given items could be inserted into this inventory.
Insert items into this inventory.
Remove items from this inventory.
Get the number of all or some items in this inventory.
Does this inventory contain nothing?
Get counts of all items in this inventory.
Does this inventory have a bar? Bar is the draggable red thing, found for example on chests, that limits the portion of the inventory that may be manipulated by machines.
Get the current bar. This is the index at which the red area starts.
Set the current bar.
Is this object valid? This Lua object holds a reference to an object within
the game engine. It is possible that the game-engine object is removed whilst
a mod still holds the corresponding Lua object. If that happens, the object
becomes invalid, i.e. this attribute will be
false. Mods are advised to
check for object validity if any change to the game state might have occurred
between the creation of the Lua object and its access.
The indexing operator.
Get the number of slots in this inventory.