Register piston_up and piston_down as effectors

This commit is contained in:
Jeija 2012-08-13 20:37:39 +02:00
parent 00ce2540c2
commit 6f9036c70b
2 changed files with 10 additions and 2 deletions

View File

@ -3,7 +3,7 @@
minetest.register_node("mesecons_pistons:piston_down_normal", { minetest.register_node("mesecons_pistons:piston_down_normal", {
description = "Piston DOWN", 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"}, 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) after_dig_node = function(pos, oldnode)
local dir = {x=0, y=-1, z=0} 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 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, end,
}) })
mesecon:register_effector("mesecons_pistons:piston_down_normal", "mesecons_pistons:piston_down_normal")
--registration sticky one: --registration sticky one:
minetest.register_node("mesecons_pistons:piston_down_sticky", { minetest.register_node("mesecons_pistons:piston_down_sticky", {
description = "Sticky Piston DOWN", 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"}, 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) after_dig_node = function(pos, oldnode)
local dir = {x=0, y=-1, z=0} 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 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, end,
}) })
mesecon:register_effector("mesecons_pistons:piston_down_sticky", "mesecons_pistons:piston_down_sticky")
minetest.register_craft({ minetest.register_craft({
output = "mesecons_pistons:piston_down_normal", output = "mesecons_pistons:piston_down_normal",
recipe = { recipe = {

View File

@ -18,6 +18,8 @@ minetest.register_node("mesecons_pistons:piston_up_normal", {
end, end,
}) })
mesecon:register_effector("mesecons_pistons:piston_up_normal", "mesecons_pistons:piston_up_normal")
--registration sticky one: --registration sticky one:
minetest.register_node("mesecons_pistons:piston_up_sticky", { minetest.register_node("mesecons_pistons:piston_up_sticky", {
description = "Sticky Piston UP", description = "Sticky Piston UP",
@ -37,6 +39,8 @@ minetest.register_node("mesecons_pistons:piston_up_sticky", {
end, end,
}) })
mesecon:register_effector("mesecons_pistons:piston_up_sticky", "mesecons_pistons:piston_up_sticky")
minetest.register_craft({ minetest.register_craft({
output = "mesecons_pistons:piston_up_normal", output = "mesecons_pistons:piston_up_normal",
recipe = { recipe = {