summaryrefslogtreecommitdiff
path: root/mesecons_pressureplates
diff options
context:
space:
mode:
authorAnthony Zhang <azhang9@gmail.com>2012-06-04 22:20:04 -0400
committerAnthony Zhang <azhang9@gmail.com>2012-06-04 22:20:04 -0400
commit4200757ba3ac7f450a6b51592339aa62af905f0e (patch)
tree178110c383ac9b629c53ffddb745deacde870375 /mesecons_pressureplates
parent95a84dde468f91a112993f8c1379ebca0362d95f (diff)
downloadmesecons-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_pressureplates')
-rw-r--r--mesecons_pressureplates/init.lua22
1 files changed, 6 insertions, 16 deletions
diff --git a/mesecons_pressureplates/init.lua b/mesecons_pressureplates/init.lua
index 56a55c2..37b3ca8 100644
--- a/mesecons_pressureplates/init.lua
+++ b/mesecons_pressureplates/init.lua
@@ -26,6 +26,9 @@ minetest.register_node("mesecons_pressureplates:pressure_plate_wood_on", {
},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3},
drop='"mesecons_pressureplates:pressure_plate_wood_off" 1',
+ after_dig_node = function(pos)
+ mesecon:receptor_off(pos, mesecon:get_rules("pressureplate"))
+ end
})
minetest.register_craft({
@@ -64,14 +67,6 @@ minetest.register_abm(
end,
})
-minetest.register_on_dignode(
- function(pos, oldnode, digger)
- if oldnode.name == "mesecons_pressureplates:pressure_plate_wood_on" then
- mesecon:receptor_off(pos, mesecon:get_rules("pressureplate"))
- end
- end
-)
-
mesecon:add_receptor_node("mesecons_pressureplates:pressure_plate_wood_on")
mesecon:add_receptor_node_off("mesecons_pressureplates:pressure_plate_wood_off")
@@ -103,6 +98,9 @@ minetest.register_node("mesecons_pressureplates:pressure_plate_stone_on", {
},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3},
drop='"mesecons_pressureplates:pressure_plate_stone_off" 1',
+ after_dig_node = function(pos)
+ mesecon:receptor_off(pos, mesecon:get_rules("pressureplate"))
+ end
})
minetest.register_craft({
@@ -141,14 +139,6 @@ minetest.register_abm(
end,
})
-minetest.register_on_dignode(
- function(pos, oldnode, digger)
- if oldnode.name == "mesecons_pressureplates:pressure_plate_stone_on" then
- mesecon:receptor_off(pos, mesecon:get_rules("pressureplate"))
- end
- end
-)
-
mesecon:add_receptor_node("mesecons_pressureplates:pressure_plate_stone_on")
mesecon:add_receptor_node_off("mesecons_pressureplates:pressure_plate_stone_off")