diff options
author | Anthony Zhang <azhang9@gmail.com> | 2012-06-04 22:20:04 -0400 |
---|---|---|
committer | Anthony Zhang <azhang9@gmail.com> | 2012-06-04 22:20:04 -0400 |
commit | 4200757ba3ac7f450a6b51592339aa62af905f0e (patch) | |
tree | 178110c383ac9b629c53ffddb745deacde870375 /mesecons_powerplant | |
parent | 95a84dde468f91a112993f8c1379ebca0362d95f (diff) | |
download | mesecons-4200757ba3ac7f450a6b51592339aa62af905f0e.tar mesecons-4200757ba3ac7f450a6b51592339aa62af905f0e.tar.gz mesecons-4200757ba3ac7f450a6b51592339aa62af905f0e.tar.bz2 mesecons-4200757ba3ac7f450a6b51592339aa62af905f0e.tar.xz mesecons-4200757ba3ac7f450a6b51592339aa62af905f0e.zip |
Remove deprecated API functions "register_on_placenode" and "register_on_dignode" where possible.
Diffstat (limited to 'mesecons_powerplant')
-rw-r--r-- | mesecons_powerplant/init.lua | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/mesecons_powerplant/init.lua b/mesecons_powerplant/init.lua index 346c076..b7e4cde 100644 --- a/mesecons_powerplant/init.lua +++ b/mesecons_powerplant/init.lua @@ -10,6 +10,12 @@ minetest.register_node("mesecons_powerplant:power_plant", { groups = {snappy=3}, light_source = LIGHT_MAX-9, description="Power Plant", + after_place_node = function(pos) + mesecon:receptor_on(pos) + end, + after_dig_node = function(pos) + mesecon:receptor_off(pos) + end }) minetest.register_craft({ @@ -21,18 +27,4 @@ minetest.register_craft({ } }) -minetest.register_on_placenode(function(pos, newnode, placer) - if newnode.name == "mesecons_powerplant:power_plant" then - mesecon:receptor_on(pos) - end -end) - -minetest.register_on_dignode( - function(pos, oldnode, digger) - if oldnode.name == "mesecons_powerplant:power_plant" then - mesecon:receptor_off(pos) - end - end -) - mesecon:add_receptor_node("mesecons_powerplant:power_plant") |