summaryrefslogtreecommitdiff
path: root/mesecons_mvps
diff options
context:
space:
mode:
authorAnthony <azhang9@gmail.com>2012-08-30 09:43:56 -0700
committerAnthony <azhang9@gmail.com>2012-08-30 09:43:56 -0700
commit5cc18d8fbd4b09e8c6075ead262e98fd8a663b35 (patch)
tree12c9e2ae746e601fb19df6786d770605b9478f4b /mesecons_mvps
parentbcd6634811d311b2e64307ccd866f20c0b60e23f (diff)
parentb7553145b088f595d3af187a0515a70aaaadc46b (diff)
downloadmesecons-5cc18d8fbd4b09e8c6075ead262e98fd8a663b35.tar
mesecons-5cc18d8fbd4b09e8c6075ead262e98fd8a663b35.tar.gz
mesecons-5cc18d8fbd4b09e8c6075ead262e98fd8a663b35.tar.bz2
mesecons-5cc18d8fbd4b09e8c6075ead262e98fd8a663b35.tar.xz
mesecons-5cc18d8fbd4b09e8c6075ead262e98fd8a663b35.zip
Merge pull request #42 from Jat15/master
Modified pistons, movestone, mvps for all liquid
Diffstat (limited to 'mesecons_mvps')
-rw-r--r--mesecons_mvps/init.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/mesecons_mvps/init.lua b/mesecons_mvps/init.lua
index 419dee0..3903910 100644
--- a/mesecons_mvps/init.lua
+++ b/mesecons_mvps/init.lua
@@ -29,7 +29,7 @@ function mesecon:mvps_push(pos, direction) -- pos: pos of mvps; direction: direc
local lnode = minetest.env:get_node(lpos)
local newnode
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.y=lpos.y+direction.y
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 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 lnode2.name == "ignore" or lnode2.name == "air" or lnode2.name == "default:water" or lnode2.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 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}
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.z = lpos2.z-direction.z
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)
end