1 local S
= minetest
.get_translator("mesecons_window")
6 if minetest
.get_modpath("default") then
7 sfx
= default
.node_sound_glass_defaults()
10 minetest
.register_node("mesecons_window:window_closed", {
11 description
=S("Mesecon Window"),
12 _doc_items_longdesc
= S("A Mesecon receptor which is opaque when it isn't powered and is fully transparent to light and sunlight when powered."),
13 tiles
= {"mesecons_window_window_closed.png"},
14 is_ground_content
= false,
15 groups
= {cracky
=3, oddly_breakable_by_hand
=3},
17 mesecons
= {conductor
= {
18 state
= mesecon
.state
.off
,
20 {x
= -1, y
= 0, z
= 0},
21 {x
= 1, y
= 0, z
= 0},
22 {x
= 0, y
= -1, z
= 0},
23 {x
= 0, y
= 1, z
= 0},
24 {x
= 0, y
= 0, z
= -1},
25 {x
= 0, y
= 0, z
= 1},
27 onstate
= "mesecons_window:window_open"
31 minetest
.register_node("mesecons_window:window_open", {
32 description
=S("Mesecon Window"),
33 _doc_items_create_entry
= false,
34 drawtype
= "glasslike_framed",
35 sunlight_propagates
= true,
36 tiles
= {"mesecons_window_window_open.png", "mesecons_window_window_open_detail.png"},
37 is_ground_content
= false,
39 groups
= {cracky
=3, oddly_breakable_by_hand
=3, not_in_creative_inventory
=1},
40 drop
= "mesecons_window:window_closed",
42 mesecons
= {conductor
= {
43 state
= mesecon
.state
.on
,
45 {x
= -1, y
= 0, z
= 0},
46 {x
= 1, y
= 0, z
= 0},
47 {x
= 0, y
= -1, z
= 0},
48 {x
= 0, y
= 1, z
= 0},
49 {x
= 0, y
= 0, z
= -1},
50 {x
= 0, y
= 0, z
= 1},
52 offstate
= "mesecons_window:window_closed"
54 on_construct
= function(pos
)
56 shadowpos
= vector
.add(pos
, vector
.new(0, 1, 0))
57 if (minetest
.get_node(shadowpos
).name
== "air") then
58 minetest
.dig_node(shadowpos
)
63 minetest
.register_node("mesecons_window:filter_closed", {
64 description
=S("Mesecon Filter Window"),
65 tiles
= {"mesecons_window_filter_closed.png"},
66 _doc_items_longdesc
= S("A Mesecon receptor which is opaque when it isn't powered and is semi-transparent to light when powered."),
67 is_ground_content
= false,
68 groups
= {cracky
=3, oddly_breakable_by_hand
=3},
70 mesecons
= {conductor
= {
71 state
= mesecon
.state
.off
,
73 {x
= -1, y
= 0, z
= 0},
74 {x
= 1, y
= 0, z
= 0},
75 {x
= 0, y
= -1, z
= 0},
76 {x
= 0, y
= 1, z
= 0},
77 {x
= 0, y
= 0, z
= -1},
78 {x
= 0, y
= 0, z
= 1},
80 onstate
= "mesecons_window:filter_open"
84 minetest
.register_node("mesecons_window:filter_open", {
85 description
=S("Mesecon Filter Window"),
86 drawtype
= "glasslike_framed",
87 _doc_items_create_entry
= false,
88 sunlight_propagates
= false,
89 tiles
= {"mesecons_window_filter_open.png", "mesecons_window_filter_open_detail.png"},
90 is_ground_content
= false,
92 groups
= {cracky
=3, oddly_breakable_by_hand
=3, not_in_creative_inventory
=1},
93 drop
= "mesecons_window:filter_closed",
95 mesecons
= {conductor
= {
96 state
= mesecon
.state
.on
,
98 {x
= -1, y
= 0, z
= 0},
99 {x
= 1, y
= 0, z
= 0},
100 {x
= 0, y
= -1, z
= 0},
101 {x
= 0, y
= 1, z
= 0},
102 {x
= 0, y
= 0, z
= -1},
103 {x
= 0, y
= 0, z
= 1},
105 offstate
= "mesecons_window:filter_closed"
107 on_construct
= function(pos
)
109 shadowpos
= vector
.add(pos
, vector
.new(0, 1, 0))
110 if (minetest
.get_node(shadowpos
).name
== "air") then
111 minetest
.dig_node(shadowpos
)
116 minetest
.register_node("mesecons_window:filter2_closed", {
117 description
=S("Mesecon Filter Glass"),
118 _doc_items_longdesc
= S("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."),
119 drawtype
="glasslike_framed",
120 tiles
= {"mesecons_window_filter2_closed.png", "mesecons_window_filter2_closed_detail.png"},
121 is_ground_content
= false,
122 groups
= {cracky
=3, oddly_breakable_by_hand
=3},
125 sunlight_propagates
= false,
126 mesecons
= {conductor
= {
127 state
= mesecon
.state
.off
,
129 {x
= -1, y
= 0, z
= 0},
130 {x
= 1, y
= 0, z
= 0},
131 {x
= 0, y
= -1, z
= 0},
132 {x
= 0, y
= 1, z
= 0},
133 {x
= 0, y
= 0, z
= -1},
134 {x
= 0, y
= 0, z
= 1},
136 onstate
= "mesecons_window:filter2_open"
138 on_construct
= function(pos
)
140 shadowpos
= vector
.add(pos
, vector
.new(0, 1, 0))
141 if (minetest
.get_node(shadowpos
).name
== "air") then
142 minetest
.dig_node(shadowpos
)
147 minetest
.register_node("mesecons_window:filter2_open", {
148 description
=S("Mesecon Filter Glass"),
149 _doc_items_create_entry
= false,
150 drawtype
= "glasslike_framed",
151 sunlight_propagates
= false,
152 tiles
= {"mesecons_window_filter2_open.png", "mesecons_window_filter2_open_detail.png"},
153 is_ground_content
= false,
155 sunlight_propagates
= true,
156 groups
= {cracky
=3, oddly_breakable_by_hand
=3, not_in_creative_inventory
=1},
157 drop
= "mesecons_window:filter2_closed",
159 mesecons
= {conductor
= {
160 state
= mesecon
.state
.on
,
162 {x
= -1, y
= 0, z
= 0},
163 {x
= 1, y
= 0, z
= 0},
164 {x
= 0, y
= -1, z
= 0},
165 {x
= 0, y
= 1, z
= 0},
166 {x
= 0, y
= 0, z
= -1},
167 {x
= 0, y
= 0, z
= 1},
169 offstate
= "mesecons_window:filter2_closed"
171 on_construct
= function(pos
)
173 shadowpos
= vector
.add(pos
, vector
.new(0, 1, 0))
174 if (minetest
.get_node(shadowpos
).name
== "air") then
175 minetest
.dig_node(shadowpos
)
180 if minetest
.get_modpath("default") then
181 minetest
.register_craft({
182 output
= 'mesecons_window:window_closed 3',
184 {"default:cobble", "default:cobble", "default:cobble"},
185 {"", "group:mesecon_conductor_craftable", ""},
186 {"default:glass", "default:glass", "default:glass"},
190 minetest
.register_craft({
191 output
= 'mesecons_window:filter_closed 3',
193 {"default:cobble", "default:cobble", "default:cobble"},
194 {"group:leaves", "group:mesecon_conductor_craftable", "group:leaves"},
195 {"default:glass", "default:glass", "default:glass"},
199 minetest
.register_craft({
200 output
= 'mesecons_window:filter2_closed 3',
202 {"group:leaves", "group:leaves", "group:leaves"},
203 {"", "group:mesecon_conductor_craftable", ""},
204 {"default:glass", "default:glass", "default:glass"},
210 if minetest
.get_modpath("doc") then
211 doc
.add_entry_alias("nodes", "mesecons_window:window_closed", "nodes", "mesecons_window:window_open")
212 doc
.add_entry_alias("nodes", "mesecons_window:filter_closed", "nodes", "mesecons_window:filter_open")
213 doc
.add_entry_alias("nodes", "mesecons_window:filter2_closed", "nodes", "mesecons_window:filter2_open")