-
Notifications
You must be signed in to change notification settings - Fork 0
/
diode.lua
40 lines (39 loc) · 957 Bytes
/
diode.lua
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
minetest.register_node("digicontrol:diode", {
description = "Digilines Diode",
inventory_image = "digicontrol_diode.png",
tiles = {
"digicontrol_diode.png",
"digicontrol_bottom.png",
"digicontrol_side_port.png",
"digicontrol_side_port.png",
"digicontrol_side.png",
"digicontrol_side.png"
},
drawtype = "nodebox",
node_box = digicontrol.node_box,
selection_box = digicontrol.selection_box,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = false,
groups = {digicontrol = 1, dig_immediate = 2},
on_rotate = digicontrol.on_rotate,
after_place_node = digilines.update_autoconnect,
after_destruct = digilines.update_autoconnect,
digiline = {
semiconductor = {
rules = function(node)
return {
digicontrol.get_rule(1, node.param2)
}
end
},
wire = {
rules = function(node)
return {
digicontrol.get_rule(1, node.param2),
digicontrol.get_rule(3, node.param2)
}
end
}
}
})