LuaTransportLine

class LuaTransportLine
clear() Remove all items from this transport line.
get_item_count(item) → uint Count some or all items on this line.
remove_item(items) → uint Remove some items from this line.
can_insert_at(position) → boolean Can an item be inserted at a given position?
can_insert_at_back() → boolean Can an item be inserted at the back of this line?
insert_at(position, items) → boolean Insert items at a given position.
insert_at_back(items) → boolean Insert items at the back of this line.
get_contents() → dictionary stringuint Get counts of all items on this line.
valid :: boolean [R] Is this object valid?
owner :: LuaEntity [R] The entity this transport line belongs to.

One line on a transport belt.

clear()

Remove all items from this transport line.

get_item_count(item) → uint

Count some or all items on this line.

Parameters
item :: string (optional): Prototype name of the item to count. If not specified, count all items.
remove_item(items) → uint

Remove some items from this line.

Parameters
items :: SimpleItemStack: Items to remove.
Return value
Number of items actually removed.
can_insert_at(position) → boolean

Can an item be inserted at a given position?

Parameters
position :: float: Where to insert an item.
can_insert_at_back() → boolean

Can an item be inserted at the back of this line?

insert_at(position, items) → boolean

Insert items at a given position.

Parameters
position :: float: Where on the line to insert the items.
items :: SimpleItemStack: Items to insert.
Return value
Were the items inserted successfully?
insert_at_back(items) → boolean

Insert items at the back of this line.

Parameters
Return value
Were the items inserted successfully?
get_contents() → dictionary stringuint

Get counts of all items on this line.

Return value
The counts, indexed by item names.
valid :: boolean [Read-only]

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.

owner :: LuaEntity [Read-only]

The entity this transport line belongs to.