Actuator ignored liquid (all)

This commit is contained in:
Jat 2012-08-30 14:20:18 +02:00
parent bcd6634811
commit b7553145b0
5 changed files with 13 additions and 35 deletions

View File

@ -99,8 +99,7 @@ mesecon:register_on_signal_on(function (pos, node)
end end
until checknode.name=="air" until checknode.name=="air"
or checknode.name=="ignore" or checknode.name=="ignore"
or checknode.name=="default:water" or not(minetest.registered_nodes[checknode.name].liquidtype == "none")
or checknode.name=="default:water_flowing"
minetest.env:remove_node(pos) minetest.env:remove_node(pos)
nodeupdate(pos) nodeupdate(pos)
minetest.env:add_entity(pos, "mesecons_movestones:movestone_entity") minetest.env:add_entity(pos, "mesecons_movestones:movestone_entity")
@ -177,8 +176,7 @@ mesecon:register_on_signal_on(function (pos, node)
end end
until checknode.name=="air" until checknode.name=="air"
or checknode.name=="ignore" or checknode.name=="ignore"
or checknode.name=="default:water" or not(minetest.registered_nodes[checknode.name].liquidtype == "none")
or checknode.name=="default:water_flowing"
repeat -- Check if it collides with a stopper (pull direction) repeat -- Check if it collides with a stopper (pull direction)
collpos={x=collpos.x-direction.x, y=collpos.y-direction.y, z=collpos.z-direction.z} collpos={x=collpos.x-direction.x, y=collpos.y-direction.y, z=collpos.z-direction.z}
checknode=minetest.env:get_node(collpos) checknode=minetest.env:get_node(collpos)
@ -187,9 +185,7 @@ mesecon:register_on_signal_on(function (pos, node)
end end
until checknode.name=="air" until checknode.name=="air"
or checknode.name=="ignore" or checknode.name=="ignore"
or checknode.name=="default:water" or not(minetest.registered_nodes[checknode.name].liquidtype == "none")
or checknode.name=="default:water_flowing"
minetest.env:remove_node(pos) minetest.env:remove_node(pos)
nodeupdate(pos) nodeupdate(pos)
minetest.env:add_entity(pos, "mesecons_movestones:sticky_movestone_entity") minetest.env:add_entity(pos, "mesecons_movestones:sticky_movestone_entity")

View File

@ -29,7 +29,7 @@ function mesecon:mvps_push(pos, direction) -- pos: pos of mvps; direction: direc
local lnode = minetest.env:get_node(lpos) local lnode = minetest.env:get_node(lpos)
local newnode local newnode
minetest.env:remove_node(lpos) minetest.env:remove_node(lpos)
while not(lnode.name == "ignore" or lnode.name == "air" or lnode.name == "default:water" or lnode.name == "default:water_flowing") do while not(lnode.name == "ignore" or lnode.name == "air" or not(minetest.registered_nodes[lnode.name].liquidtype == "none")) do
lpos.x=lpos.x+direction.x lpos.x=lpos.x+direction.x
lpos.y=lpos.y+direction.y lpos.y=lpos.y+direction.y
lpos.z=lpos.z+direction.z lpos.z=lpos.z+direction.z
@ -46,8 +46,8 @@ function mesecon:mvps_pull_all(pos, direction) -- pos: pos of mvps; direction: d
local lpos2 = {x=pos.x-direction.x*2, y=pos.y-direction.y*2, z=pos.z-direction.z*2} -- 2 away local lpos2 = {x=pos.x-direction.x*2, y=pos.y-direction.y*2, z=pos.z-direction.z*2} -- 2 away
local lnode2 = minetest.env:get_node(lpos2) local lnode2 = minetest.env:get_node(lpos2)
if lnode.name ~= "ignore" and lnode.name ~= "air" and lnode.name ~= "default:water" and lnode.name ~= "default:water_flowing" then return end if lnode.name ~= "ignore" and lnode.name ~= "air" and minetest.registered_nodes[lnode.name].liquidtype == "none" then return end
if lnode2.name == "ignore" or lnode2.name == "air" or lnode2.name == "default:water" or lnode2.name == "default:water_flowing" then return end if lnode2.name == "ignore" or lnode2.name == "air" or not(minetest.registered_nodes[lnode2.name].liquidtype == "none") then return end
local oldpos = {x=lpos2.x+direction.x, y=lpos2.y+direction.y, z=lpos2.z+direction.z} local oldpos = {x=lpos2.x+direction.x, y=lpos2.y+direction.y, z=lpos2.z+direction.z}
repeat repeat
@ -58,7 +58,7 @@ function mesecon:mvps_pull_all(pos, direction) -- pos: pos of mvps; direction: d
lpos2.y = lpos2.y-direction.y lpos2.y = lpos2.y-direction.y
lpos2.z = lpos2.z-direction.z lpos2.z = lpos2.z-direction.z
lnode = minetest.env:get_node(lpos2) lnode = minetest.env:get_node(lpos2)
until lnode.name=="air" or lnode.name=="ignore" or lnode.name=="default:water" or lnode.name=="default:water_flowing" until lnode.name=="air" or lnode.name=="ignore" or not(minetest.registered_nodes[lnode2.name].liquidtype == "none")
minetest.env:remove_node(oldpos) minetest.env:remove_node(oldpos)
end end

View File

@ -135,10 +135,7 @@ mesecon:register_on_signal_on(function(pos, node)
--check for column end --check for column end
if checknode.name == "air" if checknode.name == "air"
or checknode.name == "ignore" or checknode.name == "ignore"
or checknode.name == "default:water_source" or not(minetest.registered_nodes[checknode.name].liquidtype == "none") then
or checknode.name == "default:water_flowing"
or checknode.name == "default:lava_source"
or checknode.name == "default:lava_flowing" then
break break
end end
@ -203,10 +200,7 @@ mesecon:register_on_signal_off(function(pos, node)
checknode = minetest.env:get_node(checkpos) checknode = minetest.env:get_node(checkpos)
if checknode.name ~= "air" if checknode.name ~= "air"
and checknode.name ~= "ignore" and checknode.name ~= "ignore"
and checknode.name ~= "default:water_source" and minetest.registered_nodes[checknode.name].liquidtype == "none"
and checknode.name ~= "default:water_flowing"
and checknode.name ~= "default:lava_source"
and checknode.name ~= "default:lava_flowing"
and not mesecon:is_mvps_stopper(checknode.name) then and not mesecon:is_mvps_stopper(checknode.name) then
minetest.env:set_node(pos, checknode) minetest.env:set_node(pos, checknode)
minetest.env:remove_node(checkpos) minetest.env:remove_node(checkpos)

View File

@ -141,10 +141,7 @@ mesecon:register_on_signal_on(function(pos, node)
--check for column end --check for column end
if checknode.name == "air" if checknode.name == "air"
or checknode.name == "ignore" or checknode.name == "ignore"
or checknode.name == "default:water_source" or not(minetest.registered_nodes[checknode.name].liquidtype == "none") then
or checknode.name == "default:water_flowing"
or checknode.name == "default:lava_source"
or checknode.name == "default:lava_flowing" then
break break
end end
@ -209,10 +206,7 @@ mesecon:register_on_signal_off(function(pos, node)
checknode = minetest.env:get_node(checkpos) checknode = minetest.env:get_node(checkpos)
if checknode.name ~= "air" if checknode.name ~= "air"
and checknode.name ~= "ignore" and checknode.name ~= "ignore"
and checknode.name ~= "default:water_source" and minetest.registered_nodes[checknode.name].liquidtype == "none"
and checknode.name ~= "default:water_flowing"
and checknode.name ~= "default:lava_source"
and checknode.name ~= "default:lava_flowing"
and not mesecon:is_mvps_stopper(checknode.name) then and not mesecon:is_mvps_stopper(checknode.name) then
minetest.env:remove_node(checkpos) minetest.env:remove_node(checkpos)
mesecon:updatenode(checkpos) mesecon:updatenode(checkpos)

View File

@ -129,10 +129,7 @@ mesecon:register_on_signal_on(function(pos, node)
--check for column end --check for column end
if checknode.name == "air" if checknode.name == "air"
or checknode.name == "ignore" or checknode.name == "ignore"
or checknode.name == "default:water_source" or not(minetest.registered_nodes[checknode.name].liquidtype == "none") then
or checknode.name == "default:water_flowing"
or checknode.name == "default:lava_source"
or checknode.name == "default:lava_flowing" then
break break
end end
@ -197,10 +194,7 @@ mesecon:register_on_signal_off(function(pos, node)
checknode = minetest.env:get_node(checkpos) checknode = minetest.env:get_node(checkpos)
if checknode.name ~= "air" if checknode.name ~= "air"
and checknode.name ~= "ignore" and checknode.name ~= "ignore"
and checknode.name ~= "default:water_source" and minetest.registered_nodes[checknode.name].liquidtype == "none"
and checknode.name ~= "default:water_flowing"
and checknode.name ~= "default:lava_source"
and checknode.name ~= "default:lava_flowing"
and not mesecon:is_mvps_stopper(checknode.name) then and not mesecon:is_mvps_stopper(checknode.name) then
minetest.env:remove_node(checkpos) minetest.env:remove_node(checkpos)
mesecon:updatenode(checkpos) mesecon:updatenode(checkpos)