From 6f9036c70b853f679a96c6125aebf8d0987b5445 Mon Sep 17 00:00:00 2001 From: Jeija Date: Mon, 13 Aug 2012 20:37:39 +0200 Subject: [PATCH] Register piston_up and piston_down as effectors --- mesecons_pistons/pistons_down.lua | 8 ++++++-- mesecons_pistons/pistons_up.lua | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mesecons_pistons/pistons_down.lua b/mesecons_pistons/pistons_down.lua index 82bb3f4..4d39c7f 100644 --- a/mesecons_pistons/pistons_down.lua +++ b/mesecons_pistons/pistons_down.lua @@ -3,7 +3,7 @@ minetest.register_node("mesecons_pistons:piston_down_normal", { description = "Piston DOWN", tiles = {"jeija_piston_tb.png", "jeija_piston_side.png", "jeija_piston_tb.png", "jeija_piston_tb.png", "jeija_piston_tb.png", "jeija_piston_tb.png"}, - groups = {cracky=3, mesecon_effector_on = 1, mesecon_effector_off = 1, mesecon = 2}, + groups = {cracky=3, mesecon = 2}, after_dig_node = function(pos, oldnode) local dir = {x=0, y=-1, z=0} pos.x, pos.y, pos.z = pos.x + dir.x, pos.y + dir.y, pos.z + dir.z --move to first node to check @@ -18,11 +18,13 @@ minetest.register_node("mesecons_pistons:piston_down_normal", { end, }) +mesecon:register_effector("mesecons_pistons:piston_down_normal", "mesecons_pistons:piston_down_normal") + --registration sticky one: minetest.register_node("mesecons_pistons:piston_down_sticky", { description = "Sticky Piston DOWN", tiles = {"jeija_piston_tb.png", "jeija_piston_sticky_side.png", "jeija_piston_tb.png", "jeija_piston_tb.png", "jeija_piston_tb.png", "jeija_piston_tb.png"}, - groups = {cracky=3, mesecon_effector_on = 1, mesecon_effector_off = 1, mesecon = 2}, + groups = {cracky=3, mesecon = 2}, after_dig_node = function(pos, oldnode) local dir = {x=0, y=-1, z=0} pos.x, pos.y, pos.z = pos.x + dir.x, pos.y + dir.y, pos.z + dir.z --move to first node to check @@ -37,6 +39,8 @@ minetest.register_node("mesecons_pistons:piston_down_sticky", { end, }) +mesecon:register_effector("mesecons_pistons:piston_down_sticky", "mesecons_pistons:piston_down_sticky") + minetest.register_craft({ output = "mesecons_pistons:piston_down_normal", recipe = { diff --git a/mesecons_pistons/pistons_up.lua b/mesecons_pistons/pistons_up.lua index 1d116ca..01675e0 100644 --- a/mesecons_pistons/pistons_up.lua +++ b/mesecons_pistons/pistons_up.lua @@ -18,6 +18,8 @@ minetest.register_node("mesecons_pistons:piston_up_normal", { end, }) +mesecon:register_effector("mesecons_pistons:piston_up_normal", "mesecons_pistons:piston_up_normal") + --registration sticky one: minetest.register_node("mesecons_pistons:piston_up_sticky", { description = "Sticky Piston UP", @@ -37,6 +39,8 @@ minetest.register_node("mesecons_pistons:piston_up_sticky", { end, }) +mesecon:register_effector("mesecons_pistons:piston_up_sticky", "mesecons_pistons:piston_up_sticky") + minetest.register_craft({ output = "mesecons_pistons:piston_up_normal", recipe = {