summaryrefslogtreecommitdiff
path: root/flowing_logic.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-01-14 14:17:07 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-01-14 14:34:55 -0500
commit3a7b9fa31ce872ca15b590bf7f2667aa10ec8646 (patch)
treee94a44eaf111b981dd67aeee03974689b752d0a9 /flowing_logic.lua
parent109729cfb27efd816238f094a738a8ac23e83dda (diff)
downloadpipeworks-3a7b9fa31ce872ca15b590bf7f2667aa10ec8646.tar
pipeworks-3a7b9fa31ce872ca15b590bf7f2667aa10ec8646.tar.gz
pipeworks-3a7b9fa31ce872ca15b590bf7f2667aa10ec8646.tar.bz2
pipeworks-3a7b9fa31ce872ca15b590bf7f2667aa10ec8646.tar.xz
pipeworks-3a7b9fa31ce872ca15b590bf7f2667aa10ec8646.zip
Added a little stub to the bottom of the spigot, showing the water texture,
so that when a spigot is flowing, it looks like water is actually pouring out of it.
Diffstat (limited to 'flowing_logic.lua')
-rw-r--r--flowing_logic.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/flowing_logic.lua b/flowing_logic.lua
index d58d124..dffdabf 100644
--- a/flowing_logic.lua
+++ b/flowing_logic.lua
@@ -79,8 +79,10 @@ local spigot_check = function(pos,node)
local top = minetest.env:get_node(check[node.param2+1]).name
dbg('found '..top)
if string.find(top,'_loaded') then
+ minetest.env:add_node({x=pos.x,y=pos.y,z=pos.z},{name='pipeworks:spigot_pouring'})
minetest.env:add_node({x=pos.x,y=pos.y-1,z=pos.z},{name='default:water_source'})
elseif minetest.env:get_node({x=pos.x,y=pos.y-1,z=pos.z}).name == 'default:water_source' then
+ minetest.env:add_node({x=pos.x,y=pos.y,z=pos.z},{name='pipeworks:spigot'})
minetest.env:remove_node({x=pos.x,y=pos.y-1,z=pos.z})
end
end
@@ -100,11 +102,11 @@ minetest.register_abm({
})
minetest.register_abm({
- nodenames = {'pipeworks:outlet','pipeworks:spigot'},
+ nodenames = {'pipeworks:outlet','pipeworks:spigot','pipeworks:spigot_pouring'},
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
if node.name == 'pipeworks:outlet' then update_outlet(pos)
- elseif node.name == 'pipeworks:spigot' then spigot_check(pos,node) end
+ elseif node.name == 'pipeworks:spigot' or node.name == 'pipeworks:spigot_pouring' then spigot_check(pos,node) end
end
})