diff options
author | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2017-03-17 11:28:20 -0400 |
---|---|---|
committer | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2017-03-17 11:28:20 -0400 |
commit | 06d9243586cecb1abed74550ce2544b436572a35 (patch) | |
tree | e3cc3b59c313ffea4ef69f2be6f3182e8fc0ffa3 /pipeworks/flowing_logic.lua | |
parent | caeaae8e17f696c7bd387dd1080b1dd7edfeb379 (diff) | |
download | dreambuilder_modpack-06d9243586cecb1abed74550ce2544b436572a35.tar dreambuilder_modpack-06d9243586cecb1abed74550ce2544b436572a35.tar.gz dreambuilder_modpack-06d9243586cecb1abed74550ce2544b436572a35.tar.bz2 dreambuilder_modpack-06d9243586cecb1abed74550ce2544b436572a35.tar.xz dreambuilder_modpack-06d9243586cecb1abed74550ce2544b436572a35.zip |
update pipeworks again
Diffstat (limited to 'pipeworks/flowing_logic.lua')
-rw-r--r-- | pipeworks/flowing_logic.lua | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/pipeworks/flowing_logic.lua b/pipeworks/flowing_logic.lua index 5166b15..e1c0bf5 100644 --- a/pipeworks/flowing_logic.lua +++ b/pipeworks/flowing_logic.lua @@ -31,19 +31,32 @@ pipeworks.check_for_inflows = function(pos,node) {x=pos.x-1,y=pos.y,z=pos.z}, {x=pos.x+1,y=pos.y,z=pos.z}, {x=pos.x,y=pos.y,z=pos.z-1}, - {x=pos.x,y=pos.y,z=pos.z+1}, } + {x=pos.x,y=pos.y,z=pos.z+1}, + } local newnode = false local source = false - for i =1,6 do + for i = 1, 6 do if newnode then break end - local name = minetest.get_node(coords[i]).name + local testnode = minetest.get_node(coords[i]) + local name = testnode.name if name and (name == "pipeworks:pump_on" and pipeworks.check_for_liquids(coords[i])) or string.find(name,"_loaded") then if string.find(name,"_loaded") then source = minetest.get_meta(coords[i]):get_string("source") if source == minetest.pos_to_string(pos) then break end end - newnode = string.gsub(node.name,"empty","loaded") - source = {x=coords[i].x,y=coords[i].y,z=coords[i].z} + if string.find(name, "valve") or string.find(name, "sensor") then + + if ((i == 3 or i == 4) and minetest.facedir_to_dir(testnode.param2).x ~= 0) + or ((i == 5 or i == 6) and minetest.facedir_to_dir(testnode.param2).z ~= 0) + or ((i == 1 or i == 2) and minetest.facedir_to_dir(testnode.param2).y ~= 0) then + + newnode = string.gsub(node.name,"empty","loaded") + source = {x=coords[i].x,y=coords[i].y,z=coords[i].z} + end + else + newnode = string.gsub(node.name,"empty","loaded") + source = {x=coords[i].x,y=coords[i].y,z=coords[i].z} + end end end if newnode then |