2012-03-05 19:21:26 +01:00
|
|
|
-- PRESSURE PLATE WOOD
|
|
|
|
|
|
|
|
minetest.register_node("mesecons_pressureplates:pressure_plate_wood_off", {
|
2012-06-21 13:56:04 +02:00
|
|
|
drawtype = "nodebox",
|
2012-08-20 10:12:10 +02:00
|
|
|
tiles = {"jeija_pressure_plate_wood_off.png"},
|
2012-03-05 19:21:26 +01:00
|
|
|
inventory_image = "jeija_pressure_plate_wood_off.png",
|
|
|
|
wield_image = "jeija_pressure_plate_wood_off.png",
|
|
|
|
paramtype = "light",
|
|
|
|
is_ground_content = true,
|
2012-08-05 13:37:20 +02:00
|
|
|
walkable = true,
|
2012-03-05 19:21:26 +01:00
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
2012-08-10 03:35:34 +02:00
|
|
|
fixed = { -7/16, -8/16, -7/16, 7/16, -7/16, 7/16 },
|
2012-06-21 13:56:04 +02:00
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
2012-08-10 03:35:34 +02:00
|
|
|
fixed = { -7/16, -8/16, -7/16, 7/16, -7/16, 7/16 },
|
2012-03-05 19:21:26 +01:00
|
|
|
},
|
2012-08-11 23:39:28 +02:00
|
|
|
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3, mesecon = 2},
|
2012-03-05 19:21:26 +01:00
|
|
|
description="Wood Pressure Plate",
|
2012-12-07 15:52:52 +01:00
|
|
|
|
|
|
|
on_timer = function(pos, elapsed)
|
|
|
|
local objs = minetest.env:get_objects_inside_radius(pos, 1)
|
|
|
|
for k, obj in pairs(objs) do
|
|
|
|
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"})
|
2012-12-09 00:42:30 +01:00
|
|
|
mesecon:receptor_on(pos)
|
2012-12-07 15:52:52 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
return true
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_construct = function(pos)
|
|
|
|
minetest.env:get_node_timer(pos):start(PRESSURE_PLATE_INTERVAL)
|
|
|
|
end,
|
2012-03-05 19:21:26 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("mesecons_pressureplates:pressure_plate_wood_on", {
|
2012-06-21 13:56:04 +02:00
|
|
|
drawtype = "nodebox",
|
2012-08-20 10:12:10 +02:00
|
|
|
tiles = {"jeija_pressure_plate_wood_on.png"},
|
2012-03-05 19:21:26 +01:00
|
|
|
paramtype = "light",
|
|
|
|
is_ground_content = true,
|
2012-08-05 13:37:20 +02:00
|
|
|
walkable = true,
|
2012-03-05 19:21:26 +01:00
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
2012-08-10 03:35:34 +02:00
|
|
|
fixed = { -7/16, -8/16, -7/16, 7/16, -7/16, 7/16 },
|
2012-06-21 13:56:04 +02:00
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
2012-08-10 08:28:22 +02:00
|
|
|
fixed = { -7/16, -8/16, -7/16, 7/16, -31/64, 7/16 },
|
2012-03-05 19:21:26 +01:00
|
|
|
},
|
2012-08-11 23:39:28 +02:00
|
|
|
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,not_in_creative_inventory=1, mesecon = 2},
|
2012-03-05 19:21:26 +01:00
|
|
|
drop='"mesecons_pressureplates:pressure_plate_wood_off" 1',
|
2012-12-07 15:52:52 +01:00
|
|
|
|
|
|
|
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_wood_off"})
|
2012-12-09 00:42:30 +01:00
|
|
|
mesecon:receptor_off(pos)
|
2012-12-07 15:52:52 +01:00
|
|
|
end
|
|
|
|
return true
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_construct = function(pos)
|
|
|
|
minetest.env:get_node_timer(pos):start(PRESSURE_PLATE_INTERVAL)
|
|
|
|
end,
|
2012-03-05 19:21:26 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = '"mesecons_pressureplates:pressure_plate_wood_off" 1',
|
|
|
|
recipe = {
|
|
|
|
{'"default:wood"', '"default:wood"'},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
-- PRESSURE PLATE STONE
|
|
|
|
|
|
|
|
minetest.register_node("mesecons_pressureplates:pressure_plate_stone_off", {
|
2012-06-21 13:56:04 +02:00
|
|
|
drawtype = "nodebox",
|
2012-08-20 10:12:10 +02:00
|
|
|
tiles = {"jeija_pressure_plate_stone_off.png"},
|
2012-03-05 19:21:26 +01:00
|
|
|
inventory_image = "jeija_pressure_plate_stone_off.png",
|
|
|
|
wield_image = "jeija_pressure_plate_stone_off.png",
|
|
|
|
paramtype = "light",
|
|
|
|
is_ground_content = true,
|
2012-08-05 13:37:20 +02:00
|
|
|
walkable = true,
|
2012-03-05 19:21:26 +01:00
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
2012-08-10 03:35:34 +02:00
|
|
|
fixed = { -7/16, -8/16, -7/16, 7/16, -7/16, 7/16 },
|
2012-06-21 13:56:04 +02:00
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
2012-08-10 03:35:34 +02:00
|
|
|
fixed = { -7/16, -8/16, -7/16, 7/16, -7/16, 7/16 },
|
2012-03-05 19:21:26 +01:00
|
|
|
},
|
2012-12-09 00:42:30 +01:00
|
|
|
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3},
|
2012-03-05 19:21:26 +01:00
|
|
|
description="Stone Pressure Plate",
|
2012-12-07 15:52:52 +01:00
|
|
|
|
|
|
|
on_timer = function(pos, elapsed)
|
|
|
|
local objs = minetest.env:get_objects_inside_radius(pos, 1)
|
|
|
|
for k, obj in pairs(objs) do
|
|
|
|
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"})
|
2012-12-09 00:42:30 +01:00
|
|
|
mesecon:receptor_on(pos)
|
2012-12-07 15:52:52 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
return true
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_construct = function(pos)
|
|
|
|
minetest.env:get_node_timer(pos):start(PRESSURE_PLATE_INTERVAL)
|
|
|
|
end,
|
2012-12-09 00:42:30 +01:00
|
|
|
|
|
|
|
mesecons = {receptor = {
|
|
|
|
state = mesecon.state.off
|
|
|
|
}}
|
2012-03-05 19:21:26 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("mesecons_pressureplates:pressure_plate_stone_on", {
|
2012-06-21 13:56:04 +02:00
|
|
|
drawtype = "nodebox",
|
2012-08-20 10:12:10 +02:00
|
|
|
tiles = {"jeija_pressure_plate_stone_on.png"},
|
2012-03-05 19:21:26 +01:00
|
|
|
paramtype = "light",
|
|
|
|
is_ground_content = true,
|
2012-08-05 13:37:20 +02:00
|
|
|
walkable = true,
|
2012-03-05 19:21:26 +01:00
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
2012-08-10 03:35:34 +02:00
|
|
|
fixed = { -7/16, -8/16, -7/16, 7/16, -7/16, 7/16 },
|
2012-06-21 13:56:04 +02:00
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
2012-08-10 08:28:22 +02:00
|
|
|
fixed = { -7/16, -8/16, -7/16, 7/16, -31/64, 7/16 },
|
2012-03-05 19:21:26 +01:00
|
|
|
},
|
2012-12-09 00:42:30 +01:00
|
|
|
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
|
2012-03-05 19:21:26 +01:00
|
|
|
drop='"mesecons_pressureplates:pressure_plate_stone_off" 1',
|
2012-12-07 15:52:52 +01:00
|
|
|
|
|
|
|
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"})
|
2012-12-09 00:42:30 +01:00
|
|
|
mesecon:receptor_off(pos)
|
2012-12-07 15:52:52 +01:00
|
|
|
end
|
|
|
|
return true
|
|
|
|
end,
|
|
|
|
|
|
|
|
on_construct = function(pos)
|
|
|
|
minetest.env:get_node_timer(pos):start(PRESSURE_PLATE_INTERVAL)
|
|
|
|
end,
|
2012-12-09 00:42:30 +01:00
|
|
|
|
|
|
|
mesecons = {receptor = {
|
|
|
|
state = mesecon.state.off
|
|
|
|
}}
|
2012-03-05 19:21:26 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = '"mesecons_pressureplates:pressure_plate_stone_off" 1',
|
|
|
|
recipe = {
|
|
|
|
{'"default:cobble"', '"default:cobble"'},
|
|
|
|
}
|
|
|
|
})
|