diff options
author | h-v-smacker <hans-von-smacker+github@gmail.com> | 2017-11-30 11:48:51 +0300 |
---|---|---|
committer | h-v-smacker <hans-von-smacker+github@gmail.com> | 2017-11-30 11:48:51 +0300 |
commit | 83c3030494913d86e6d5f9614bba77fe663b2301 (patch) | |
tree | 1e2cd532347db652722f93f71d67677be11cce89 | |
parent | 8fa259c93fbef467822f710a33537a76f608b7cb (diff) |
Explicitly report the color of incoming port for items in tubes
-rw-r--r-- | lua_tube.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lua_tube.lua b/lua_tube.lua index 51665ae..8cc4468 100644 --- a/lua_tube.lua +++ b/lua_tube.lua @@ -731,8 +731,17 @@ for white = 0, 1 do connect_sides = {front = 1, back = 1, left = 1, right = 1, top = 1, bottom = 1}, priority = 50, 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, { type = "item", + pin = src, itemstring = stack:to_string(), item = stack:to_table(), velocity = velocity, |