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_detector | |
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_detector')
-rw-r--r-- | mesecons_detector/init.lua | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/mesecons_detector/init.lua b/mesecons_detector/init.lua index 75e9b77..4fe90a2 100644 --- a/mesecons_detector/init.lua +++ b/mesecons_detector/init.lua @@ -12,12 +12,15 @@ minetest.register_node("mesecons_detector:object_detector_on", { paramtype = "light", walkable = true, groups = {cracky=3}, - drop = '"mesecons_detector:object_detector_off" 1', + drop = 'mesecons_detector:object_detector_off', description="Player Detector", + after_dig_node = function(pos) + mesecon:receptor_off(pos, mesecon:get_rules("pressureplate")) + end }) minetest.register_craft({ - output = '"mesecons_detector:object_detector_off" 1', + output = 'mesecons_detector:object_detector_off', recipe = { {"default:steelblock", '', "default:steelblock"}, {"default:steelblock", "mesecons_materials:ic", "default:steelblock"}, @@ -42,7 +45,7 @@ minetest.register_abm( minetest.env:add_node(pos, {name="mesecons_detector:object_detector_on"}) mesecon:receptor_on(pos, mesecon:get_rules("pressureplate")) end - end + end end, }) @@ -65,7 +68,7 @@ minetest.register_abm( objectfound=objectfound + 1 end end - end + end if objectfound==0 then minetest.env:add_node(pos, {name="mesecons_detector:object_detector_off"}) mesecon:receptor_off(pos, mesecon:get_rules("pressureplate")) @@ -73,13 +76,5 @@ minetest.register_abm( end, }) -minetest.register_on_dignode( - function(pos, oldnode, digger) - if oldnode.name == "mesecons_detector:object_detector_on" then - mesecon:receptor_off(pos, mesecon:get_rules("pressureplate")) - end - end -) - mesecon:add_receptor_node("mesecons_detector:object_detector_on") mesecon:add_receptor_node_off("mesecons_detector:object_detector_off") |