diff options
author | Jeija <norrepli@gmail.com> | 2012-12-11 19:49:55 +0100 |
---|---|---|
committer | Jeija <norrepli@gmail.com> | 2012-12-11 19:49:55 +0100 |
commit | de46729b971b5e59394834b8a01d4a7005318114 (patch) | |
tree | 5a2cf1f18b485ddefa8e255ac6d6a600ef2e2e12 /mesecons_pressureplates | |
parent | 31f3c99288355193dc68a6e83dfc63140fd02fa0 (diff) | |
parent | 5540fcbcb31eb32003fa0391113ed3b1dea25e47 (diff) | |
download | mesecons-de46729b971b5e59394834b8a01d4a7005318114.tar mesecons-de46729b971b5e59394834b8a01d4a7005318114.tar.gz mesecons-de46729b971b5e59394834b8a01d4a7005318114.tar.bz2 mesecons-de46729b971b5e59394834b8a01d4a7005318114.tar.xz mesecons-de46729b971b5e59394834b8a01d4a7005318114.zip |
Merge branch 'mesecons_in_nodedef'
Conflicts:
mesecons/internal.lua
Diffstat (limited to 'mesecons_pressureplates')
-rw-r--r-- | mesecons_pressureplates/init.lua | 43 |
1 files changed, 14 insertions, 29 deletions
diff --git a/mesecons_pressureplates/init.lua b/mesecons_pressureplates/init.lua index 49edb48..2e88d2f 100644 --- a/mesecons_pressureplates/init.lua +++ b/mesecons_pressureplates/init.lua @@ -25,7 +25,7 @@ minetest.register_node("mesecons_pressureplates:pressure_plate_wood_off", { local objpos=obj:getpos() if objpos.y>pos.y-1 and objpos.y<pos.y then minetest.env:add_node(pos, {name="mesecons_pressureplates:pressure_plate_wood_on"}) - mesecon:receptor_on(pos, mesecon:get_rules("pressureplate")) + mesecon:receptor_on(pos) end end return true @@ -57,7 +57,7 @@ minetest.register_node("mesecons_pressureplates:pressure_plate_wood_on", { local objs = minetest.env:get_objects_inside_radius(pos, 1) if objs[1]==nil then minetest.env:add_node(pos, {name="mesecons_pressureplates:pressure_plate_wood_off"}) - mesecon:receptor_off(pos, mesecon:get_rules("pressureplate")) + mesecon:receptor_off(pos) end return true end, @@ -92,7 +92,7 @@ minetest.register_node("mesecons_pressureplates:pressure_plate_stone_off", { type = "fixed", fixed = { -7/16, -8/16, -7/16, 7/16, -7/16, 7/16 }, }, - groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3, mesecon = 2}, + groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3}, description="Stone Pressure Plate", on_timer = function(pos, elapsed) @@ -101,7 +101,7 @@ minetest.register_node("mesecons_pressureplates:pressure_plate_stone_off", { local objpos=obj:getpos() if objpos.y>pos.y-1 and objpos.y<pos.y then minetest.env:add_node(pos, {name="mesecons_pressureplates:pressure_plate_stone_on"}) - mesecon:receptor_on(pos, mesecon:get_rules("pressureplate")) + mesecon:receptor_on(pos) end end return true @@ -110,6 +110,10 @@ minetest.register_node("mesecons_pressureplates:pressure_plate_stone_off", { on_construct = function(pos) minetest.env:get_node_timer(pos):start(PRESSURE_PLATE_INTERVAL) end, + + mesecons = {receptor = { + state = mesecon.state.off + }} }) minetest.register_node("mesecons_pressureplates:pressure_plate_stone_on", { @@ -126,14 +130,14 @@ minetest.register_node("mesecons_pressureplates:pressure_plate_stone_on", { type = "fixed", fixed = { -7/16, -8/16, -7/16, 7/16, -31/64, 7/16 }, }, - groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,not_in_creative_inventory=1, mesecon = 2}, + groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,not_in_creative_inventory=1}, drop='"mesecons_pressureplates:pressure_plate_stone_off" 1', on_timer = function(pos, elapsed) local objs = minetest.env:get_objects_inside_radius(pos, 1) if objs[1]==nil then minetest.env:add_node(pos, {name="mesecons_pressureplates:pressure_plate_stone_off"}) - mesecon:receptor_off(pos, mesecon:get_rules("pressureplate")) + mesecon:receptor_off(pos) end return true end, @@ -141,6 +145,10 @@ minetest.register_node("mesecons_pressureplates:pressure_plate_stone_on", { on_construct = function(pos) minetest.env:get_node_timer(pos):start(PRESSURE_PLATE_INTERVAL) end, + + mesecons = {receptor = { + state = mesecon.state.off + }} }) minetest.register_craft({ @@ -149,26 +157,3 @@ minetest.register_craft({ {'"default:cobble"', '"default:cobble"'}, } }) - -mesecon:add_rules("pressureplate", -{{x=0, y=1, z=-1}, -{x=0, y=0, z=-1}, -{x=0, y=-1, z=-1}, -{x=0, y=1, z=1}, -{x=0, y=-1, z=1}, -{x=0, y=0, z=1}, -{x=1, y=0, z=0}, -{x=1, y=1, z=0}, -{x=1, y=-1, z=0}, -{x=-1, y=1, z=0}, -{x=-1, y=-1, z=0}, -{x=-1, y=0, z=0}, -{x=0, y=-1, z=0}, -{x=0, y=-2, z=0}, -{x=0, y=1, z=0}}) - -mesecon:add_receptor_node("mesecons_pressureplates:pressure_plate_wood_on", mesecon:get_rules("pressureplate")) -mesecon:add_receptor_node_off("mesecons_pressureplates:pressure_plate_wood_off", mesecon:get_rules("pressureplate")) - -mesecon:add_receptor_node("mesecons_pressureplates:pressure_plate_stone_on", mesecon:get_rules("pressureplate")) -mesecon:add_receptor_node_off("mesecons_pressureplates:pressure_plate_stone_off", mesecon:get_rules("pressureplate")) |