1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
-- PRESSURE PLATE WOOD
minetest.register_node("mesecons_pressureplates:pressure_plate_wood_off", {
drawtype = "raillike",
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",
},
groups = {choppy=2},
description="Wood Pressure Plate",
})
minetest.register_node("mesecons_pressureplates:pressure_plate_wood_on", {
drawtype = "raillike",
tile_images = {"jeija_pressure_plate_wood_on.png"},
paramtype = "light",
is_ground_content = true,
walkable = false,
selection_box = {
type = "fixed",
},
groups = {choppy=2},
drop='"mesecons_pressureplates:pressure_plate_wood_off" 1',
})
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"})
mesecon:receptor_on(pos, "pressureplate")
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"})
mesecon:receptor_off(pos, "pressureplate")
end
end,
})
minetest.register_on_dignode(
function(pos, oldnode, digger)
if oldnode.name == "mesecons_pressureplates:pressure_plate_wood_on" then
mesecon:receptor_off(pos, "pressureplate")
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", {
drawtype = "raillike",
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",
},
groups = {choppy=2},
description="Stone Pressure Plate",
})
minetest.register_node("mesecons_pressureplates:pressure_plate_stone_on", {
drawtype = "raillike",
tile_images = {"jeija_pressure_plate_stone_on.png"},
paramtype = "light",
is_ground_content = true,
walkable = false,
selection_box = {
type = "fixed",
},
groups = {choppy=2},
drop='"mesecons_pressureplates:pressure_plate_stone_off" 1',
})
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"})
mesecon:receptor_on(pos, "pressureplate")
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"})
mesecon:receptor_off(pos, "pressureplate")
end
end,
})
minetest.register_on_dignode(
function(pos, oldnode, digger)
if oldnode.name == "mesecons_pressureplates:pressure_plate_stone_on" then
mesecon:receptor_off(pos, "pressureplate")
end
end
)
mesecon:add_receptor_node("mesecons_pressureplates:pressure_plate_stone_on")
mesecon:add_receptor_node_off("mesecons_pressureplates:pressure_plate_stone_off")
|