mirror of
https://github.com/mt-mods/pipeworks.git
synced 2024-12-28 08:37:28 +01:00
Merge pull request #209 from h-v-smacker/luatube_pin_report
Explicitly report the color of incoming port for items coming through tubes
This commit is contained in:
commit
cb692d2188
@ -731,8 +731,17 @@ for white = 0, 1 do
|
|||||||
connect_sides = {front = 1, back = 1, left = 1, right = 1, top = 1, bottom = 1},
|
connect_sides = {front = 1, back = 1, left = 1, right = 1, top = 1, bottom = 1},
|
||||||
priority = 50,
|
priority = 50,
|
||||||
can_go = function(pos, node, velocity, stack)
|
can_go = function(pos, node, velocity, stack)
|
||||||
|
local src = {name = nil}
|
||||||
|
-- add color of the incoming tube explicitly; referring to rules, in case they change later
|
||||||
|
for color, rule in pairs(rules) do
|
||||||
|
if (-velocity.x == rule.x and -velocity.y == rule.y and -velocity.z == rule.z) then
|
||||||
|
src.name = rule.name
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
local succ, msg = run(pos, {
|
local succ, msg = run(pos, {
|
||||||
type = "item",
|
type = "item",
|
||||||
|
pin = src,
|
||||||
itemstring = stack:to_string(),
|
itemstring = stack:to_string(),
|
||||||
item = stack:to_table(),
|
item = stack:to_table(),
|
||||||
velocity = velocity,
|
velocity = velocity,
|
||||||
|
Loading…
Reference in New Issue
Block a user