diff options
author | Jeija <norrepli@gmail.com> | 2012-12-09 00:42:30 +0100 |
---|---|---|
committer | Jeija <norrepli@gmail.com> | 2012-12-09 00:42:30 +0100 |
commit | b37bdbf55cf6d3205d5dd7a2491a8bd855cbbd76 (patch) | |
tree | ffc05ac9f096fc635535701cd287d4e5ad6b5073 /mesecons_pistons/init.lua | |
parent | cf6080f7237af1c55a6d80bea4725dcb5c8cb1eb (diff) |
Port a lot more (basically everything apart from gates, pistons and extrawire crossing) to the new nodedef system. There are some problems with wall button and wall lever (in the way they visually connect to wires)
Diffstat (limited to 'mesecons_pistons/init.lua')
-rw-r--r-- | mesecons_pistons/init.lua | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/mesecons_pistons/init.lua b/mesecons_pistons/init.lua index 935ca66..dd3f599 100644 --- a/mesecons_pistons/init.lua +++ b/mesecons_pistons/init.lua @@ -1,5 +1,11 @@ --PISTONS +local update = function(pos, node) + local timer = minetest.env:get_node_timer(pos) + timer:stop() + timer:start(0) +end + minetest.register_node("mesecons_pistons:piston_normal", { description = "Piston", tiles = {"jeija_piston_tb.png", "jeija_piston_tb.png", "jeija_piston_tb.png", "jeija_piston_tb.png", "jeija_piston_tb.png", "jeija_piston_side.png"}, @@ -25,8 +31,10 @@ minetest.register_node("mesecons_pistons:piston_normal", { end return false end, + mesecons = {effector={ + action_change = update + }} }) -mesecon:register_effector("mesecons_pistons:piston_normal", "mesecons_pistons:piston_normal") minetest.register_node("mesecons_pistons:piston_sticky", { description = "Sticky Piston", @@ -53,8 +61,10 @@ minetest.register_node("mesecons_pistons:piston_sticky", { end return false end, + mesecons = {effector={ + action_change = update + }} }) -mesecon:register_effector("mesecons_pistons:piston_sticky", "mesecons_pistons:piston_sticky") minetest.register_craft({ output = '"mesecons_pistons:piston_normal" 2', @@ -127,18 +137,6 @@ minetest.register_node("mesecons_pistons:piston_pusher_sticky", { mesecon:register_mvps_stopper("mesecons_pistons:piston_pusher_normal") mesecon:register_mvps_stopper("mesecons_pistons:piston_pusher_sticky") -local update = function(pos, node) - if node.name ~= "mesecons_pistons:piston_normal" and node.name ~= "mesecons_pistons:piston_sticky" then - return - end - - local timer = minetest.env:get_node_timer(pos) - timer:stop() - timer:start(0) -end -mesecon:register_on_signal_on(update) --push action -mesecon:register_on_signal_off(update) --pull action - function mesecon:piston_push(pos) local node = minetest.env:get_node(pos) local dir = mesecon:piston_get_direction(node) |