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-03-05 19:21:26 +01:00
|
|
|
tile_images = {"jeija_pressure_plate_wood_off.png"},
|
|
|
|
inventory_image = "jeija_pressure_plate_wood_off.png",
|
|
|
|
wield_image = "jeija_pressure_plate_wood_off.png",
|
|
|
|
paramtype = "light",
|
|
|
|
is_ground_content = true,
|
|
|
|
walkable = false,
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
2012-06-21 19:54:23 +02:00
|
|
|
fixed = {-0.45, -0.5, -0.45, 0.45, -0.45, 0.45},
|
2012-06-21 13:56:04 +02:00
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
2012-06-21 19:54:23 +02:00
|
|
|
fixed = {-0.45, -0.5, -0.45, 0.45, -0.45, 0.45},
|
2012-03-05 19:21:26 +01:00
|
|
|
},
|
2012-03-26 17:58:59 +02:00
|
|
|
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3},
|
2012-03-05 19:21:26 +01:00
|
|
|
description="Wood Pressure Plate",
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("mesecons_pressureplates:pressure_plate_wood_on", {
|
2012-06-21 13:56:04 +02:00
|
|
|
drawtype = "nodebox",
|
2012-03-05 19:21:26 +01:00
|
|
|
tile_images = {"jeija_pressure_plate_wood_on.png"},
|
|
|
|
paramtype = "light",
|
|
|
|
is_ground_content = true,
|
|
|
|
walkable = false,
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
2012-06-21 19:54:23 +02:00
|
|
|
fixed = {-0.45, -0.5, -0.45, 0.45, -0.48, 0.45},
|
2012-06-21 13:56:04 +02:00
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
2012-06-21 19:54:23 +02:00
|
|
|
fixed = {-0.45, -0.5, -0.45, 0.45, -0.48, 0.45},
|
2012-03-05 19:21:26 +01:00
|
|
|
},
|
2012-08-01 11:58:19 +02: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_wood_off" 1',
|
2012-06-05 04:20:04 +02:00
|
|
|
after_dig_node = function(pos)
|
|
|
|
mesecon:receptor_off(pos, mesecon:get_rules("pressureplate"))
|
|
|
|
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"'},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_abm(
|
|
|
|
{nodenames = {"mesecons_pressureplates:pressure_plate_wood_off"},
|
|
|
|
interval = 1.0,
|
|
|
|
chance = 1,
|
|
|
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
|
|
|
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-03-29 11:49:37 +02:00
|
|
|
mesecon:receptor_on(pos, mesecon:get_rules("pressureplate"))
|
2012-03-05 19:21:26 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_abm(
|
|
|
|
{nodenames = {"mesecons_pressureplates:pressure_plate_wood_on"},
|
|
|
|
interval = 1.0,
|
|
|
|
chance = 1,
|
|
|
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
|
|
|
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-03-29 11:49:37 +02:00
|
|
|
mesecon:receptor_off(pos, mesecon:get_rules("pressureplate"))
|
2012-03-05 19:21:26 +01:00
|
|
|
end
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
mesecon:add_receptor_node("mesecons_pressureplates:pressure_plate_wood_on")
|
|
|
|
mesecon:add_receptor_node_off("mesecons_pressureplates:pressure_plate_wood_off")
|
|
|
|
|
|
|
|
-- PRESSURE PLATE STONE
|
|
|
|
|
|
|
|
minetest.register_node("mesecons_pressureplates:pressure_plate_stone_off", {
|
2012-06-21 13:56:04 +02:00
|
|
|
drawtype = "nodebox",
|
2012-03-05 19:21:26 +01:00
|
|
|
tile_images = {"jeija_pressure_plate_stone_off.png"},
|
|
|
|
inventory_image = "jeija_pressure_plate_stone_off.png",
|
|
|
|
wield_image = "jeija_pressure_plate_stone_off.png",
|
|
|
|
paramtype = "light",
|
|
|
|
is_ground_content = true,
|
|
|
|
walkable = false,
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
2012-07-19 16:28:24 +02:00
|
|
|
fixed = {-0.45, -0.5, -0.45, 0.45, -0.45, 0.45},
|
2012-06-21 13:56:04 +02:00
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
2012-07-19 16:28:24 +02:00
|
|
|
fixed = {-0.45, -0.5, -0.45, 0.45, -0.45, 0.45},
|
2012-03-05 19:21:26 +01:00
|
|
|
},
|
2012-03-26 17:58:59 +02:00
|
|
|
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3},
|
2012-03-05 19:21:26 +01:00
|
|
|
description="Stone Pressure Plate",
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("mesecons_pressureplates:pressure_plate_stone_on", {
|
2012-06-21 13:56:04 +02:00
|
|
|
drawtype = "nodebox",
|
2012-03-05 19:21:26 +01:00
|
|
|
tile_images = {"jeija_pressure_plate_stone_on.png"},
|
|
|
|
paramtype = "light",
|
|
|
|
is_ground_content = true,
|
|
|
|
walkable = false,
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
2012-07-19 16:28:24 +02:00
|
|
|
fixed = {-0.45, -0.5, -0.45, 0.45, -0.48, 0.45},
|
2012-06-21 13:56:04 +02:00
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
2012-07-19 16:28:24 +02:00
|
|
|
fixed = {-0.45, -0.5, -0.45, 0.45, -0.48, 0.45},
|
2012-03-05 19:21:26 +01:00
|
|
|
},
|
2012-08-01 11:58:19 +02: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-06-05 04:20:04 +02:00
|
|
|
after_dig_node = function(pos)
|
|
|
|
mesecon:receptor_off(pos, mesecon:get_rules("pressureplate"))
|
|
|
|
end
|
2012-03-05 19:21:26 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = '"mesecons_pressureplates:pressure_plate_stone_off" 1',
|
|
|
|
recipe = {
|
|
|
|
{'"default:cobble"', '"default:cobble"'},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_abm(
|
|
|
|
{nodenames = {"mesecons_pressureplates:pressure_plate_stone_off"},
|
|
|
|
interval = 1.0,
|
|
|
|
chance = 1,
|
|
|
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
|
|
|
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-03-29 11:49:37 +02:00
|
|
|
mesecon:receptor_on(pos, mesecon:get_rules("pressureplate"))
|
2012-03-05 19:21:26 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_abm(
|
|
|
|
{nodenames = {"mesecons_pressureplates:pressure_plate_stone_on"},
|
|
|
|
interval = 1.0,
|
|
|
|
chance = 1,
|
|
|
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
|
|
|
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-03-29 11:49:37 +02:00
|
|
|
mesecon:receptor_off(pos, mesecon:get_rules("pressureplate"))
|
2012-03-05 19:21:26 +01:00
|
|
|
end
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
mesecon:add_receptor_node("mesecons_pressureplates:pressure_plate_stone_on")
|
|
|
|
mesecon:add_receptor_node_off("mesecons_pressureplates:pressure_plate_stone_off")
|
2012-03-29 11:37:00 +02:00
|
|
|
|
|
|
|
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},
|
2012-03-29 11:49:37 +02:00
|
|
|
{x=0, y=-2, z=0},
|
2012-03-29 11:37:00 +02:00
|
|
|
{x=0, y=1, z=0}})
|