summaryrefslogtreecommitdiff
path: root/mesecons_temperest
diff options
context:
space:
mode:
authorAnthony Zhang <azhang9@gmail.com>2012-03-09 22:49:37 -0500
committerAnthony Zhang <azhang9@gmail.com>2012-03-09 22:49:37 -0500
commit84656e079d834ab3289d7ba071ee010812948436 (patch)
tree452e44cc8e91fed267b4c9045a8c2a398b354f5d /mesecons_temperest
parent36ae0cc1a54538742f1d1f3709bb2c1840a33539 (diff)
downloadmesecons-84656e079d834ab3289d7ba071ee010812948436.tar
mesecons-84656e079d834ab3289d7ba071ee010812948436.tar.gz
mesecons-84656e079d834ab3289d7ba071ee010812948436.tar.bz2
mesecons-84656e079d834ab3289d7ba071ee010812948436.tar.xz
mesecons-84656e079d834ab3289d7ba071ee010812948436.zip
Vertical mesecon plugs and sockets! Plugs will now affect sockets on a level two below or two above, as long as there is air between them.
Diffstat (limited to 'mesecons_temperest')
-rw-r--r--mesecons_temperest/init.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/mesecons_temperest/init.lua b/mesecons_temperest/init.lua
index 308f7b6..fb0ec8d 100644
--- a/mesecons_temperest/init.lua
+++ b/mesecons_temperest/init.lua
@@ -72,6 +72,12 @@ local plug_on = function(pos, node)
local lnode = minetest.env:get_node({x=pos.x+1, y=pos.y, z=pos.z}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_on({x=pos.x+2, y=pos.y, z=pos.z}) end
+ lnode = minetest.env:get_node({x=pos.x, y=pos.y-1, z=pos.z}) --a node between this node and the one two nodes away
+ if lnode.name=="air" then set_node_on({x=pos.x, y=pos.y-2, z=pos.z}) end
+
+ lnode = minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}) --a node between this node and the one two nodes away
+ if lnode.name=="air" then set_node_on({x=pos.x, y=pos.y+2, z=pos.z}) end
+
local lnode = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z-1}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_on({x=pos.x, y=pos.y, z=pos.z-2}) end
@@ -88,6 +94,12 @@ local plug_off = function(pos, node)
lnode = minetest.env:get_node({x=pos.x+1, y=pos.y, z=pos.z}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_off({x=pos.x+2, y=pos.y, z=pos.z}) end
+ lnode = minetest.env:get_node({x=pos.x, y=pos.y-1, z=pos.z}) --a node between this node and the one two nodes away
+ if lnode.name=="air" then set_node_off({x=pos.x, y=pos.y-2, z=pos.z}) end
+
+ lnode = minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}) --a node between this node and the one two nodes away
+ if lnode.name=="air" then set_node_off({x=pos.x, y=pos.y+2, z=pos.z}) end
+
lnode = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z-1}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_off({x=pos.x, y=pos.y, z=pos.z-2}) end