summaryrefslogtreecommitdiff
path: root/lua_tube.lua
diff options
context:
space:
mode:
authorroot <root@linuxworks.belug.de>2017-12-25 21:00:24 +0100
committerroot <root@linuxworks.belug.de>2017-12-25 21:00:24 +0100
commitcef707301574f80a9f759056cf248e049a5fe6d6 (patch)
tree0c4b0058bc020d9661e980def73225da49d7d01c /lua_tube.lua
parent584945a80994ea84f4c28482b7c0da7875490849 (diff)
parentcb692d21881541df2fca011ecdfbc43c127787ea (diff)
Merge branch 'master' of https://github.com/minetest-mods/pipeworks
Diffstat (limited to 'lua_tube.lua')
-rw-r--r--lua_tube.lua9
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,