4 if minetest
.get_modpath("default") then
5 sfx
= default
.node_sound_glass_defaults()
8 minetest
.register_node("mesecons_window:window_closed", {
9 description
="Mesecon Window",
10 _doc_items_longdesc
= "A Mesecon receptor which is opaque when it isn't powered and is fully transparent to light and sunlight when powered.",
11 tiles
= {"mesecons_window_closed.png"},
12 is_ground_content
= false,
13 groups
= {cracky
=3, oddly_breakable_by_hand
=3},
15 mesecons
= {conductor
= {
16 state
= mesecon
.state
.off
,
18 {x
= -1, y
= 0, z
= 0},
19 {x
= 1, y
= 0, z
= 0},
20 {x
= 0, y
= -1, z
= 0},
21 {x
= 0, y
= 1, z
= 0},
22 {x
= 0, y
= 0, z
= -1},
23 {x
= 0, y
= 0, z
= 1},
25 onstate
= "mesecons_window:window_open"
29 minetest
.register_node("mesecons_window:window_open", {
30 description
="Mesecon Window",
31 _doc_items_create_entry
= false,
32 drawtype
= "glasslike_framed",
33 sunlight_propagates
= true,
34 tiles
= {"mesecons_window_open.png", "mesecons_window_open_detail.png"},
35 is_ground_content
= false,
37 groups
= {cracky
=3, oddly_breakable_by_hand
=3, not_in_creative_inventory
=1},
38 drop
= "mesecons_window:window_closed",
40 mesecons
= {conductor
= {
41 state
= mesecon
.state
.on
,
43 {x
= -1, y
= 0, z
= 0},
44 {x
= 1, y
= 0, z
= 0},
45 {x
= 0, y
= -1, z
= 0},
46 {x
= 0, y
= 1, z
= 0},
47 {x
= 0, y
= 0, z
= -1},
48 {x
= 0, y
= 0, z
= 1},
50 offstate
= "mesecons_window:window_closed"
52 on_construct
= function(pos
)
54 shadowpos
= vector
.add(pos
, vector
.new(0, 1, 0))
55 if (minetest
.get_node(shadowpos
).name
== "air") then
56 minetest
.dig_node(shadowpos
)
61 minetest
.register_node("mesecons_window:filter_closed", {
62 description
="Mesecon Filter Window",
63 tiles
= {"mesecons_filter_closed.png"},
64 _doc_items_longdesc
= "A Mesecon receptor which is opaque when it isn't powered and is semi-transparent to light when powered.",
65 is_ground_content
= false,
66 groups
= {cracky
=3, oddly_breakable_by_hand
=3},
68 mesecons
= {conductor
= {
69 state
= mesecon
.state
.off
,
71 {x
= -1, y
= 0, z
= 0},
72 {x
= 1, y
= 0, z
= 0},
73 {x
= 0, y
= -1, z
= 0},
74 {x
= 0, y
= 1, z
= 0},
75 {x
= 0, y
= 0, z
= -1},
76 {x
= 0, y
= 0, z
= 1},
78 onstate
= "mesecons_window:filter_open"
82 minetest
.register_node("mesecons_window:filter_open", {
83 description
="Mesecon Filter Window",
84 drawtype
= "glasslike_framed",
85 _doc_items_create_entry
= false,
86 sunlight_propagates
= false,
87 tiles
= {"mesecons_filter_open.png", "mesecons_filter_open_detail.png"},
88 is_ground_content
= false,
90 groups
= {cracky
=3, oddly_breakable_by_hand
=3, not_in_creative_inventory
=1},
91 drop
= "mesecons_window:filter_closed",
93 mesecons
= {conductor
= {
94 state
= mesecon
.state
.on
,
96 {x
= -1, y
= 0, z
= 0},
97 {x
= 1, y
= 0, z
= 0},
98 {x
= 0, y
= -1, z
= 0},
99 {x
= 0, y
= 1, z
= 0},
100 {x
= 0, y
= 0, z
= -1},
101 {x
= 0, y
= 0, z
= 1},
103 offstate
= "mesecons_window:filter_closed"
105 on_construct
= function(pos
)
107 shadowpos
= vector
.add(pos
, vector
.new(0, 1, 0))
108 if (minetest
.get_node(shadowpos
).name
== "air") then
109 minetest
.dig_node(shadowpos
)
114 minetest
.register_node("mesecons_window:filter2_closed", {
115 description
="Mesecon Filter Glass",
116 _doc_items_longdesc
= "A Mesecon receptor which lets light through. When not powered, it is semi-transparent, i.e. it is transparent to light, but filters out sunlight. When powered, it is fully transparent to light and sunlight.",
117 drawtype
="glasslike_framed",
118 tiles
= {"mesecons_filter2_closed.png", "mesecons_filter2_closed_detail.png"},
119 is_ground_content
= false,
120 groups
= {cracky
=3, oddly_breakable_by_hand
=3},
123 sunlight_propagates
= false,
124 mesecons
= {conductor
= {
125 state
= mesecon
.state
.off
,
127 {x
= -1, y
= 0, z
= 0},
128 {x
= 1, y
= 0, z
= 0},
129 {x
= 0, y
= -1, z
= 0},
130 {x
= 0, y
= 1, z
= 0},
131 {x
= 0, y
= 0, z
= -1},
132 {x
= 0, y
= 0, z
= 1},
134 onstate
= "mesecons_window:filter2_open"
136 on_construct
= function(pos
)
138 shadowpos
= vector
.add(pos
, vector
.new(0, 1, 0))
139 if (minetest
.get_node(shadowpos
).name
== "air") then
140 minetest
.dig_node(shadowpos
)
145 minetest
.register_node("mesecons_window:filter2_open", {
146 description
="Mesecon Filter Glass",
147 _doc_items_create_entry
= false,
148 drawtype
= "glasslike_framed",
149 sunlight_propagates
= false,
150 tiles
= {"mesecons_filter2_open.png", "mesecons_filter2_open_detail.png"},
151 is_ground_content
= false,
153 sunlight_propagates
= true,
154 groups
= {cracky
=3, oddly_breakable_by_hand
=3, not_in_creative_inventory
=1},
155 drop
= "mesecons_window:filter2_closed",
157 mesecons
= {conductor
= {
158 state
= mesecon
.state
.on
,
160 {x
= -1, y
= 0, z
= 0},
161 {x
= 1, y
= 0, z
= 0},
162 {x
= 0, y
= -1, z
= 0},
163 {x
= 0, y
= 1, z
= 0},
164 {x
= 0, y
= 0, z
= -1},
165 {x
= 0, y
= 0, z
= 1},
167 offstate
= "mesecons_window:filter2_closed"
169 on_construct
= function(pos
)
171 shadowpos
= vector
.add(pos
, vector
.new(0, 1, 0))
172 if (minetest
.get_node(shadowpos
).name
== "air") then
173 minetest
.dig_node(shadowpos
)
178 if minetest
.get_modpath("default") then
179 minetest
.register_craft({
180 output
= 'mesecons_window:window_closed',
182 {"", "default:glass", ""},
183 {"default:cobble", "group:mesecon_conductor_craftable", "default:cobble"},
187 minetest
.register_craft({
188 output
= 'mesecons_window:filter_closed',
190 {"", "default:pine_needles", ""},
191 {"default:cobble", "group:mesecon_conductor_craftable", "default:cobble"},
195 minetest
.register_craft({
196 output
= 'mesecons_window:filter2_closed',
198 {"", "default:glass", ""},
199 {"default:pine_needles", "group:mesecon_conductor_craftable", "default:pine_needles"},
204 if minetest
.get_modpath("doc") then
205 doc
.add_entry_alias("nodes", "mesecons_window:window_closed", "nodes", "mesecons_window:window_open")
206 doc
.add_entry_alias("nodes", "mesecons_window:filter_closed", "nodes", "mesecons_window:filter_open")
207 doc
.add_entry_alias("nodes", "mesecons_window:filter2_closed", "nodes", "mesecons_window:filter2_open")