One line on a transport belt.
LuaEntityunknownfalseThe entity this transport line belongs to.
Array<LuaTransportLine>unknownfalseThe transport lines that this transport line outputs items to or an empty table if none.
Array<LuaTransportLine>unknownfalseThe transport lines that this transport line is fed by or an empty table if none.
floatunknownfalseLength of the transport line. Items can be inserted at line position from 0 up to returned value
doubleunknownfalseTotal length of segment which consists of this line, all lines in front and lines in the back directly connected.
booleanunknownfalseIs 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.
stringunknownfalseThe class name of this object. Available even when valid is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
LuaTransportLine.clear()
transportLine.clear()
takes_table: falsetable_optional: falseRemove all items from this transport line.
LuaTransportLine.get_item_count(item?: ItemFilter) -> uint32
transportLine.get_item_count()
takes_table: falsetable_optional: falseCount some or all items on this line, similar to how LuaInventory::get_item_count does.
item?: ItemFilter — If not specified, count all items.uint32LuaTransportLine.remove_item(items: ItemStackIdentification) -> uint32
transportLine.remove_item(items)
takes_table: falsetable_optional: falseRemove some items from this line.
items: ItemStackIdentification — Items to remove.uint32 — Number of items actually removed.LuaTransportLine.can_insert_at(position: float) -> boolean
transportLine.can_insert_at(position)
takes_table: falsetable_optional: falseCan an item be inserted at a given position?
position: float — Where to insert an item.booleanLuaTransportLine.can_insert_at_back() -> boolean
transportLine.can_insert_at_back()
takes_table: falsetable_optional: falseCan an item be inserted at the back of this line?
booleanLuaTransportLine.insert_at(position: float, items: ItemStackIdentification, belt_stack_size?: uint8) -> boolean
transportLine.insert_at(position, items, belt_stack_size)
takes_table: falsetable_optional: falseInsert items at a given position.
position: float — Where on the line to insert the items.items: ItemStackIdentification — Items to insert.belt_stack_size?: uint8 — Maximum size of stack created on beltboolean — Were the items inserted successfully?LuaTransportLine.insert_at_back(items: ItemStackIdentification, belt_stack_size?: uint8) -> boolean
transportLine.insert_at_back(items, belt_stack_size)
takes_table: falsetable_optional: falseInsert items at the back of this line.
items: ItemStackIdentificationbelt_stack_size?: uint8 — Maximum size of stack created on beltboolean — Were the items inserted successfully?LuaTransportLine.force_insert_at(position: float, items: ItemStackIdentification, belt_stack_size?: uint8)
transportLine.force_insert_at(position, items, belt_stack_size)
takes_table: falsetable_optional: falseForce insert item at a given position. Inserts item onto a transport line. If a position is out of range, it is clamped to a closest valid position on the transport line. Item will be inserted regardless of other items nearby, possibly forcing items to become squashed.
position: float — Where on the line to insert the items.items: ItemStackIdentification — Items to insert.belt_stack_size?: uint8 — Maximum size of stack created on beltLuaTransportLine.get_contents() -> ItemWithQualityCounts
transportLine.get_contents()
takes_table: falsetable_optional: falseGet counts of all items on this line, similar to how LuaInventory::get_contents does.
ItemWithQualityCounts — List of all items on this line.LuaTransportLine.get_detailed_contents() -> Array<DetailedItemOnLine>
transportLine.get_detailed_contents()
takes_table: falsetable_optional: falseGet detailed information of items on this line, such as their position.
Array<DetailedItemOnLine>LuaTransportLine.line_equals(other: LuaTransportLine) -> boolean
transportLine.line_equals(other)
takes_table: falsetable_optional: falseReturns whether the associated internal transport line of this line is the same as the others associated internal transport line.
This can return true even when the LuaTransportLine::owners are different (so this == other is false), because the internal transport lines can span multiple tiles.
other: LuaTransportLinebooleanLuaTransportLine.get_line_item_position(position: float) -> MapPosition
transportLine.get_line_item_position(position)
takes_table: falsetable_optional: falseGet a map position related to a position on a transport line.
position: float — Linear position along the transport line. Clamped to the transport line range.MapPosition