summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Zhang <azhang9@gmail.com>2013-03-14 14:19:02 -0400
committerAnthony Zhang <azhang9@gmail.com>2013-03-14 14:19:02 -0400
commit588e41c786e4f741f5e45e6487fc0893df504fae (patch)
tree2b25b834c311460030525a980afcc8c535f63894
parent79bb4a343345f1d4825f5bed8d2a24cfe8c4ce8e (diff)
downloadmesecons-588e41c786e4f741f5e45e6487fc0893df504fae.tar
mesecons-588e41c786e4f741f5e45e6487fc0893df504fae.tar.gz
mesecons-588e41c786e4f741f5e45e6487fc0893df504fae.tar.bz2
mesecons-588e41c786e4f741f5e45e6487fc0893df504fae.tar.xz
mesecons-588e41c786e4f741f5e45e6487fc0893df504fae.zip
Up/down pistons should also have special rules excluding the pusher side (rotated versions of normal pistons).
-rw-r--r--mesecons_pistons/init.lua28
1 files changed, 28 insertions, 0 deletions
diff --git a/mesecons_pistons/init.lua b/mesecons_pistons/init.lua
index d496b1e..701c95a 100644
--- a/mesecons_pistons/init.lua
+++ b/mesecons_pistons/init.lua
@@ -10,6 +10,26 @@ piston_rules =
{x=0, y=1, z=1},
{x=0, y=-1, z=1}}
+local piston_up_rules =
+{{x=0, y=0, z=-1}, --everything apart from y+ (pusher side)
+ {x=1, y=0, z=0},
+ {x=-1, y=0, z=0},
+ {x=0, y=0, z=1},
+ {x=1, y=-1, z=0},
+ {x=-1, y=-1, z=0},
+ {x=0, y=-1, z=1},
+ {x=0, y=-1, z=-1}}
+
+local piston_down_rules =
+{{x=0, y=0, z=-1}, --everything apart from y- (pusher side)
+ {x=1, y=0, z=0},
+ {x=-1, y=0, z=0},
+ {x=0, y=0, z=1},
+ {x=1, y=1, z=0},
+ {x=-1, y=1, z=0},
+ {x=0, y=1, z=1},
+ {x=0, y=1, z=-1}}
+
local piston_get_rules = function (node)
local rules = piston_rules
for i = 1, node.param2 do
@@ -319,6 +339,7 @@ minetest.register_node("mesecons_pistons:piston_up_normal_off", {
mesecons_piston = pistonspec_normal_up,
mesecons = {effector={
action_on = piston_on,
+ rules = piston_up_rules,
}}
})
@@ -346,6 +367,7 @@ minetest.register_node("mesecons_pistons:piston_up_normal_on", {
sounds = default.node_sound_wood_defaults(),
mesecons = {effector={
action_off = piston_off,
+ rules = piston_up_rules,
}}
})
@@ -401,6 +423,7 @@ minetest.register_node("mesecons_pistons:piston_up_sticky_off", {
sounds = default.node_sound_wood_defaults(),
mesecons = {effector={
action_on = piston_on,
+ rules = piston_up_rules,
}}
})
@@ -428,6 +451,7 @@ minetest.register_node("mesecons_pistons:piston_up_sticky_on", {
sounds = default.node_sound_wood_defaults(),
mesecons = {effector={
action_off = piston_off,
+ rules = piston_up_rules,
}}
})
@@ -501,6 +525,7 @@ minetest.register_node("mesecons_pistons:piston_down_normal_off", {
sounds = default.node_sound_wood_defaults(),
mesecons = {effector={
action_on = piston_on,
+ rules = piston_down_rules,
}}
})
@@ -528,6 +553,7 @@ minetest.register_node("mesecons_pistons:piston_down_normal_on", {
sounds = default.node_sound_wood_defaults(),
mesecons = {effector={
action_off = piston_off,
+ rules = piston_down_rules,
}}
})
@@ -579,6 +605,7 @@ minetest.register_node("mesecons_pistons:piston_down_sticky_off", {
sounds = default.node_sound_wood_defaults(),
mesecons = {effector={
action_on = piston_on,
+ rules = piston_down_rules,
}}
})
@@ -606,6 +633,7 @@ minetest.register_node("mesecons_pistons:piston_down_sticky_on", {
sounds = default.node_sound_wood_defaults(),
mesecons = {effector={
action_off = piston_off,
+ rules = piston_down_rules,
}}
})