diff options
| author | Jeija <norrepli@gmail.com> | 2012-08-13 20:17:45 +0200 | 
|---|---|---|
| committer | Jeija <norrepli@gmail.com> | 2012-08-13 20:17:45 +0200 | 
| commit | 00ce2540c22340ed02135d74c6d70a35757e8deb (patch) | |
| tree | 24f5ee80cf20e3eb2a9a303a52ead63ff685fecd /mesecons_pistons | |
| parent | 24c50571f788a2d946ee905dd295124affc88d8b (diff) | |
New effector system, effectors have to be registered with mesecon:register_effector(onstate, offstate, rules, function get_rules) rules and function get_rules are optional. You don't have to specify both onstate and offstate (required for e.g. removestone)
Diffstat (limited to 'mesecons_pistons')
| -rw-r--r-- | mesecons_pistons/init.lua | 6 | 
1 files changed, 4 insertions, 2 deletions
| diff --git a/mesecons_pistons/init.lua b/mesecons_pistons/init.lua index 1c0a8a8..1bf7034 100644 --- a/mesecons_pistons/init.lua +++ b/mesecons_pistons/init.lua @@ -3,7 +3,7 @@  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"}, -	groups = {cracky=3, mesecon_effector_on = 1, mesecon_effector_off = 1, mesecon = 2}, +	groups = {cracky=3, mesecon = 2},  	paramtype2 = "facedir",  	after_dig_node = function(pos, oldnode)  		local dir = mesecon:piston_get_direction(oldnode) @@ -18,12 +18,13 @@ minetest.register_node("mesecons_pistons:piston_normal", {  		end  	end,  }) +mesecon:register_effector("mesecons_pistons:piston_normal", "mesecons_pistons:piston_normal")  --registration sticky one:  minetest.register_node("mesecons_pistons:piston_sticky", {  	description = "Sticky Piston",  	tiles = {"jeija_piston_tb.png", "jeija_piston_tb.png", "jeija_piston_tb.png", "jeija_piston_tb.png", "jeija_piston_tb.png", "jeija_piston_sticky_side.png"}, -	groups = {cracky=3, mesecon_effector_on = 1, mesecon_effector_off = 1, mesecon = 2}, +	groups = {cracky=3, mesecon = 2},  	paramtype2 = "facedir",  	after_dig_node = function(pos, oldnode)  		local dir = mesecon:piston_get_direction(oldnode) @@ -38,6 +39,7 @@ minetest.register_node("mesecons_pistons:piston_sticky", {  		end  	end,  }) +mesecon:register_effector("mesecons_pistons:piston_sticky", "mesecons_pistons:piston_sticky")  minetest.register_craft({  	output = '"mesecons_pistons:piston_normal" 2', | 
