commit | author | age
|
37d9d9
|
1 |
-- NOTE: The code is takes directly from VanessaE's homedecor mod. |
K |
2 |
-- I just made it the lights into indictive appliances for this mod. |
|
3 |
|
|
4 |
-- This file supplies electric powered glowlights |
|
5 |
|
|
6 |
-- Boilerplate to support localized strings if intllib mod is installed. |
|
7 |
local S |
|
8 |
if (minetest.get_modpath("intllib")) then |
|
9 |
dofile(minetest.get_modpath("intllib").."/intllib.lua") |
|
10 |
S = intllib.Getter(minetest.get_current_modname()) |
|
11 |
else |
|
12 |
S = function ( s ) return s end |
|
13 |
end |
|
14 |
|
|
15 |
function technic_homedecor_node_is_owned(pos, placer) |
|
16 |
local ownername = false |
|
17 |
if type(IsPlayerNodeOwner) == "function" then -- node_ownership mod |
|
18 |
if HasOwner(pos, placer) then -- returns true if the node is owned |
|
19 |
if not IsPlayerNodeOwner(pos, placer:get_player_name()) then |
|
20 |
if type(getLastOwner) == "function" then -- ...is an old version |
|
21 |
ownername = getLastOwner(pos) |
|
22 |
elseif type(GetNodeOwnerName) == "function" then -- ...is a recent version |
|
23 |
ownername = GetNodeOwnerName(pos) |
|
24 |
else |
|
25 |
ownername = S("someone") |
|
26 |
end |
|
27 |
end |
|
28 |
end |
|
29 |
|
|
30 |
elseif type(isprotect)=="function" then -- glomie's protection mod |
|
31 |
if not isprotect(5, pos, placer) then |
|
32 |
ownername = S("someone") |
|
33 |
end |
|
34 |
elseif type(protector)=="table" and type(protector.can_dig)=="function" then -- Zeg9's protection mod |
|
35 |
if not protector.can_dig(5, pos, placer) then |
|
36 |
ownername = S("someone") |
|
37 |
end |
|
38 |
end |
|
39 |
|
|
40 |
if ownername ~= false then |
|
41 |
minetest.chat_send_player( placer:get_player_name(), S("Sorry, %s owns that spot."):format(ownername) ) |
|
42 |
return true |
|
43 |
else |
|
44 |
return false |
|
45 |
end |
|
46 |
end |
|
47 |
|
|
48 |
local dirs1 = { 20, 23, 22, 21 } |
|
49 |
local dirs2 = { 9, 18, 7, 12 } |
|
50 |
|
ee5c6c
|
51 |
local technic_homedecor_rotate_and_place = function(itemstack, placer, pointed_thing) |
37d9d9
|
52 |
if not technic_homedecor_node_is_owned(pointed_thing.under, placer) |
K |
53 |
and not technic_homedecor_node_is_owned(pointed_thing.above, placer) then |
|
54 |
local node = minetest.env:get_node(pointed_thing.under) |
|
55 |
if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].on_rightclick then |
|
56 |
|
|
57 |
local above = pointed_thing.above |
|
58 |
local under = pointed_thing.under |
|
59 |
local pitch = placer:get_look_pitch() |
|
60 |
local pname = minetest.env:get_node(under).name |
|
61 |
local node = minetest.env:get_node(above) |
|
62 |
local fdir = minetest.dir_to_facedir(placer:get_look_dir()) |
|
63 |
local wield_name = itemstack:get_name() |
|
64 |
|
|
65 |
if not minetest.registered_nodes[pname] |
|
66 |
or not minetest.registered_nodes[pname].on_rightclick then |
|
67 |
|
|
68 |
local iswall = (above.x ~= under.x) or (above.z ~= under.z) |
|
69 |
local isceiling = (above.x == under.x) and (above.z == under.z) and (pitch > 0) |
|
70 |
local pos1 = above |
|
71 |
|
|
72 |
if minetest.registered_nodes[pname]["buildable_to"] then |
|
73 |
pos1 = under |
|
74 |
iswall = false |
|
75 |
end |
|
76 |
|
|
77 |
if not minetest.registered_nodes[minetest.env:get_node(pos1).name]["buildable_to"] then return end |
|
78 |
|
|
79 |
if iswall then |
|
80 |
minetest.env:add_node(pos1, {name = wield_name, param2 = dirs2[fdir+1] }) -- place wall variant |
|
81 |
elseif isceiling then |
|
82 |
minetest.env:add_node(pos1, {name = wield_name, param2 = 20 }) -- place upside down variant |
|
83 |
else |
|
84 |
minetest.env:add_node(pos1, {name = wield_name, param2 = 0 }) -- place right side up |
|
85 |
end |
|
86 |
|
|
87 |
if not homedecor_expect_infinite_stacks then |
|
88 |
itemstack:take_item() |
|
89 |
return itemstack |
|
90 |
end |
|
91 |
end |
|
92 |
else |
|
93 |
minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack) |
|
94 |
end |
|
95 |
end |
|
96 |
end |
|
97 |
|
|
98 |
-- Yellow -- Half node |
|
99 |
minetest.register_node('technic:homedecor_glowlight_half_yellow', { |
|
100 |
description = S("Yellow Glowlight (thick)"), |
|
101 |
drawtype = "nodebox", |
|
102 |
tiles = { |
|
103 |
'technic_homedecor_glowlight_yellow_tb.png', |
|
104 |
'technic_homedecor_glowlight_yellow_tb.png', |
|
105 |
'technic_homedecor_glowlight_thick_yellow_sides.png', |
|
106 |
'technic_homedecor_glowlight_thick_yellow_sides.png', |
|
107 |
'technic_homedecor_glowlight_thick_yellow_sides.png', |
|
108 |
'technic_homedecor_glowlight_thick_yellow_sides.png' |
|
109 |
}, |
|
110 |
selection_box = { |
|
111 |
type = "fixed", |
|
112 |
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 } |
|
113 |
}, |
|
114 |
node_box = { |
|
115 |
type = "fixed", |
|
116 |
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 } |
|
117 |
}, |
|
118 |
|
|
119 |
sunlight_propagates = false, |
|
120 |
paramtype = "light", |
|
121 |
paramtype2 = "facedir", |
|
122 |
walkable = true, |
|
123 |
sounds = default.node_sound_wood_defaults(), |
|
124 |
|
|
125 |
groups = { snappy = 3 }, |
|
126 |
on_place = function(itemstack, placer, pointed_thing) |
|
127 |
technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing) |
|
128 |
return itemstack |
|
129 |
end, |
|
130 |
on_construct = function(pos) |
ee5c6c
|
131 |
technic.inductive_on_construct(pos, 100, "Yellow Glowlight (thick)") |
37d9d9
|
132 |
end, |
K |
133 |
on_punch = function(pos, node, puncher) |
ee5c6c
|
134 |
technic.inductive_on_punch_off(pos, 100, "technic:homedecor_glowlight_half_yellow_active") |
37d9d9
|
135 |
end |
K |
136 |
}) |
|
137 |
|
|
138 |
minetest.register_node('technic:homedecor_glowlight_half_yellow_active', { |
|
139 |
description = S("Yellow Glowlight (thick)"), |
|
140 |
drawtype = "nodebox", |
|
141 |
tiles = { |
|
142 |
'technic_homedecor_glowlight_yellow_tb.png', |
|
143 |
'technic_homedecor_glowlight_yellow_tb.png', |
|
144 |
'technic_homedecor_glowlight_thick_yellow_sides.png', |
|
145 |
'technic_homedecor_glowlight_thick_yellow_sides.png', |
|
146 |
'technic_homedecor_glowlight_thick_yellow_sides.png', |
|
147 |
'technic_homedecor_glowlight_thick_yellow_sides.png' |
|
148 |
}, |
|
149 |
selection_box = { |
|
150 |
type = "fixed", |
|
151 |
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 } |
|
152 |
}, |
|
153 |
node_box = { |
|
154 |
type = "fixed", |
|
155 |
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 } |
|
156 |
}, |
|
157 |
|
|
158 |
sunlight_propagates = false, |
|
159 |
paramtype = "light", |
|
160 |
paramtype2 = "facedir", |
|
161 |
walkable = true, |
|
162 |
light_source = LIGHT_MAX, |
|
163 |
sounds = default.node_sound_wood_defaults(), |
|
164 |
|
|
165 |
groups = { snappy = 3, not_in_creative_inventory=1}, |
|
166 |
drop="technic:homedecor_glowlight_half_yellow", |
|
167 |
on_place = function(itemstack, placer, pointed_thing) |
|
168 |
technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing) |
|
169 |
return itemstack |
|
170 |
end, |
|
171 |
on_construct = function(pos) |
ee5c6c
|
172 |
technic.inductive_on_construct(pos, 100, "Yellow Glowlight (thick)") |
37d9d9
|
173 |
end, |
K |
174 |
on_punch = function(pos, node, puncher) |
ee5c6c
|
175 |
technic.inductive_on_punch_on(pos, 0, "technic:homedecor_glowlight_half_yellow") |
37d9d9
|
176 |
end |
K |
177 |
}) |
|
178 |
|
|
179 |
-- Yellow -- Quarter node |
|
180 |
minetest.register_node('technic:homedecor_glowlight_quarter_yellow', { |
|
181 |
description = S("Yellow Glowlight (thin)"), |
|
182 |
drawtype = "nodebox", |
|
183 |
tiles = { |
|
184 |
'technic_homedecor_glowlight_yellow_tb.png', |
|
185 |
'technic_homedecor_glowlight_yellow_tb.png', |
|
186 |
'technic_homedecor_glowlight_thin_yellow_sides.png', |
|
187 |
'technic_homedecor_glowlight_thin_yellow_sides.png', |
|
188 |
'technic_homedecor_glowlight_thin_yellow_sides.png', |
|
189 |
'technic_homedecor_glowlight_thin_yellow_sides.png' |
|
190 |
}, |
|
191 |
selection_box = { |
|
192 |
type = "fixed", |
|
193 |
fixed = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 } |
|
194 |
}, |
|
195 |
node_box = { |
|
196 |
type = "fixed", |
|
197 |
fixed = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 } |
|
198 |
}, |
|
199 |
|
|
200 |
sunlight_propagates = false, |
|
201 |
paramtype = "light", |
|
202 |
paramtype2 = "facedir", |
|
203 |
walkable = true, |
|
204 |
sounds = default.node_sound_wood_defaults(), |
|
205 |
|
|
206 |
groups = { snappy = 3 }, |
|
207 |
on_place = function(itemstack, placer, pointed_thing) |
|
208 |
technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing) |
|
209 |
return itemstack |
|
210 |
end, |
|
211 |
on_construct = function(pos) |
ee5c6c
|
212 |
technic.inductive_on_construct(pos, 100, "Yellow Glowlight (thin)") |
37d9d9
|
213 |
end, |
K |
214 |
on_punch = function(pos, node, puncher) |
ee5c6c
|
215 |
technic.inductive_on_punch_off(pos, 100, "technic:homedecor_glowlight_quarter_yellow_active") |
37d9d9
|
216 |
end |
K |
217 |
}) |
|
218 |
|
|
219 |
minetest.register_node('technic:homedecor_glowlight_quarter_yellow_active', { |
|
220 |
description = S("Yellow Glowlight (thin)"), |
|
221 |
drawtype = "nodebox", |
|
222 |
tiles = { |
|
223 |
'technic_homedecor_glowlight_yellow_tb.png', |
|
224 |
'technic_homedecor_glowlight_yellow_tb.png', |
|
225 |
'technic_homedecor_glowlight_thin_yellow_sides.png', |
|
226 |
'technic_homedecor_glowlight_thin_yellow_sides.png', |
|
227 |
'technic_homedecor_glowlight_thin_yellow_sides.png', |
|
228 |
'technic_homedecor_glowlight_thin_yellow_sides.png' |
|
229 |
}, |
|
230 |
selection_box = { |
|
231 |
type = "fixed", |
|
232 |
fixed = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 } |
|
233 |
}, |
|
234 |
node_box = { |
|
235 |
type = "fixed", |
|
236 |
fixed = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 } |
|
237 |
}, |
|
238 |
|
|
239 |
sunlight_propagates = false, |
|
240 |
paramtype = "light", |
|
241 |
paramtype2 = "facedir", |
|
242 |
walkable = true, |
|
243 |
light_source = LIGHT_MAX-1, |
|
244 |
sounds = default.node_sound_wood_defaults(), |
|
245 |
|
|
246 |
groups = { snappy = 3, not_in_creative_inventory=1}, |
|
247 |
drop="technic:homedecor_glowlight_quarter_yellow", |
|
248 |
on_place = function(itemstack, placer, pointed_thing) |
|
249 |
technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing) |
|
250 |
return itemstack |
|
251 |
end, |
|
252 |
on_construct = function(pos) |
ee5c6c
|
253 |
technic.inductive_on_construct(pos, 100, "Yellow Glowlight (thin)") |
37d9d9
|
254 |
end, |
K |
255 |
on_punch = function(pos, node, puncher) |
ee5c6c
|
256 |
technic.inductive_on_punch_on(pos, 0, "technic:homedecor_glowlight_quarter_yellow") |
37d9d9
|
257 |
end |
K |
258 |
}) |
|
259 |
|
|
260 |
|
|
261 |
-- White -- half node |
|
262 |
minetest.register_node('technic:homedecor_glowlight_half_white', { |
|
263 |
description = S("White Glowlight (thick)"), |
|
264 |
drawtype = "nodebox", |
|
265 |
tiles = { |
|
266 |
'technic_homedecor_glowlight_white_tb.png', |
|
267 |
'technic_homedecor_glowlight_white_tb.png', |
|
268 |
'technic_homedecor_glowlight_thick_white_sides.png', |
|
269 |
'technic_homedecor_glowlight_thick_white_sides.png', |
|
270 |
'technic_homedecor_glowlight_thick_white_sides.png', |
|
271 |
'technic_homedecor_glowlight_thick_white_sides.png' |
|
272 |
}, |
|
273 |
selection_box = { |
|
274 |
type = "fixed", |
|
275 |
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 } |
|
276 |
}, |
|
277 |
node_box = { |
|
278 |
type = "fixed", |
|
279 |
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 } |
|
280 |
}, |
|
281 |
|
|
282 |
sunlight_propagates = false, |
|
283 |
paramtype = "light", |
|
284 |
paramtype2 = "facedir", |
|
285 |
walkable = true, |
|
286 |
sounds = default.node_sound_wood_defaults(), |
|
287 |
|
|
288 |
groups = { snappy = 3 }, |
|
289 |
on_place = function(itemstack, placer, pointed_thing) |
|
290 |
technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing) |
|
291 |
return itemstack |
|
292 |
end, |
|
293 |
on_construct = function(pos) |
ee5c6c
|
294 |
technic.inductive_on_construct(pos, 100, "White Glowlight (thick)") |
37d9d9
|
295 |
end, |
K |
296 |
on_punch = function(pos, node, puncher) |
ee5c6c
|
297 |
technic.inductive_on_punch_off(pos, 100, "technic:homedecor_glowlight_half_white_active") |
37d9d9
|
298 |
end |
K |
299 |
}) |
|
300 |
|
|
301 |
minetest.register_node('technic:homedecor_glowlight_half_white_active', { |
|
302 |
description = S("White Glowlight (thick)"), |
|
303 |
drawtype = "nodebox", |
|
304 |
tiles = { |
|
305 |
'technic_homedecor_glowlight_white_tb.png', |
|
306 |
'technic_homedecor_glowlight_white_tb.png', |
|
307 |
'technic_homedecor_glowlight_thick_white_sides.png', |
|
308 |
'technic_homedecor_glowlight_thick_white_sides.png', |
|
309 |
'technic_homedecor_glowlight_thick_white_sides.png', |
|
310 |
'technic_homedecor_glowlight_thick_white_sides.png' |
|
311 |
}, |
|
312 |
selection_box = { |
|
313 |
type = "fixed", |
|
314 |
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 } |
|
315 |
}, |
|
316 |
node_box = { |
|
317 |
type = "fixed", |
|
318 |
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 } |
|
319 |
}, |
|
320 |
|
|
321 |
sunlight_propagates = false, |
|
322 |
paramtype = "light", |
|
323 |
paramtype2 = "facedir", |
|
324 |
walkable = true, |
|
325 |
light_source = LIGHT_MAX, |
|
326 |
sounds = default.node_sound_wood_defaults(), |
|
327 |
|
|
328 |
groups = { snappy = 3, not_in_creative_inventory=1}, |
|
329 |
drop="technic:homedecor_glowlight_half_white", |
|
330 |
on_place = function(itemstack, placer, pointed_thing) |
|
331 |
technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing) |
|
332 |
return itemstack |
|
333 |
end, |
|
334 |
on_construct = function(pos) |
ee5c6c
|
335 |
technic.inductive_on_construct(pos, 100, "White Glowlight (thick)") |
37d9d9
|
336 |
end, |
K |
337 |
on_punch = function(pos, node, puncher) |
ee5c6c
|
338 |
technic.inductive_on_punch_on(pos, 0, "technic:homedecor_glowlight_half_white") |
37d9d9
|
339 |
end |
K |
340 |
}) |
|
341 |
|
|
342 |
-- White -- Quarter node |
|
343 |
minetest.register_node('technic:homedecor_glowlight_quarter_white', { |
|
344 |
description = S("White Glowlight (thin)"), |
|
345 |
drawtype = "nodebox", |
|
346 |
tiles = { |
|
347 |
'technic_homedecor_glowlight_white_tb.png', |
|
348 |
'technic_homedecor_glowlight_white_tb.png', |
|
349 |
'technic_homedecor_glowlight_thin_white_sides.png', |
|
350 |
'technic_homedecor_glowlight_thin_white_sides.png', |
|
351 |
'technic_homedecor_glowlight_thin_white_sides.png', |
|
352 |
'technic_homedecor_glowlight_thin_white_sides.png' |
|
353 |
}, |
|
354 |
selection_box = { |
|
355 |
type = "fixed", |
|
356 |
fixed = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 } |
|
357 |
}, |
|
358 |
node_box = { |
|
359 |
type = "fixed", |
|
360 |
fixed = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 } |
|
361 |
}, |
|
362 |
|
|
363 |
sunlight_propagates = false, |
|
364 |
paramtype = "light", |
|
365 |
paramtype2 = "facedir", |
|
366 |
walkable = true, |
|
367 |
sounds = default.node_sound_wood_defaults(), |
|
368 |
|
|
369 |
groups = { snappy = 3 }, |
|
370 |
on_place = function(itemstack, placer, pointed_thing) |
|
371 |
technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing) |
|
372 |
return itemstack |
|
373 |
end, |
|
374 |
on_construct = function(pos) |
ee5c6c
|
375 |
technic.inductive_on_construct(pos, 100, "White Glowlight (thin)") |
37d9d9
|
376 |
end, |
K |
377 |
on_punch = function(pos, node, puncher) |
ee5c6c
|
378 |
technic.inductive_on_punch_off(pos, 100, "technic:homedecor_glowlight_quarter_white_active") |
37d9d9
|
379 |
end |
K |
380 |
}) |
|
381 |
|
|
382 |
minetest.register_node('technic:homedecor_glowlight_quarter_white_active', { |
|
383 |
description = S("White Glowlight (thin)"), |
|
384 |
drawtype = "nodebox", |
|
385 |
tiles = { |
|
386 |
'technic_homedecor_glowlight_white_tb.png', |
|
387 |
'technic_homedecor_glowlight_white_tb.png', |
|
388 |
'technic_homedecor_glowlight_thin_white_sides.png', |
|
389 |
'technic_homedecor_glowlight_thin_white_sides.png', |
|
390 |
'technic_homedecor_glowlight_thin_white_sides.png', |
|
391 |
'technic_homedecor_glowlight_thin_white_sides.png' |
|
392 |
}, |
|
393 |
selection_box = { |
|
394 |
type = "fixed", |
|
395 |
fixed = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 } |
|
396 |
}, |
|
397 |
node_box = { |
|
398 |
type = "fixed", |
|
399 |
fixed = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 } |
|
400 |
}, |
|
401 |
|
|
402 |
sunlight_propagates = false, |
|
403 |
paramtype = "light", |
|
404 |
paramtype2 = "facedir", |
|
405 |
walkable = true, |
|
406 |
light_source = LIGHT_MAX-1, |
|
407 |
sounds = default.node_sound_wood_defaults(), |
|
408 |
|
|
409 |
groups = { snappy = 3, not_in_creative_inventory=1}, |
|
410 |
drop="technic:homedecor_glowlight_quarter_white", |
|
411 |
on_place = function(itemstack, placer, pointed_thing) |
|
412 |
technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing) |
|
413 |
return itemstack |
|
414 |
end, |
|
415 |
on_construct = function(pos) |
ee5c6c
|
416 |
technic.inductive_on_construct(pos, 100, "White Glowlight (thin)") |
37d9d9
|
417 |
end, |
K |
418 |
on_punch = function(pos, node, puncher) |
ee5c6c
|
419 |
technic.inductive_on_punch_on(pos, 0, "technic:homedecor_glowlight_quarter_white") |
37d9d9
|
420 |
end |
K |
421 |
}) |
|
422 |
|
|
423 |
-- Glowlight "cubes" - yellow |
|
424 |
minetest.register_node('technic:homedecor_glowlight_small_cube_yellow', { |
|
425 |
description = S("Yellow Glowlight (small cube)"), |
|
426 |
drawtype = "nodebox", |
|
427 |
tiles = { |
|
428 |
'technic_homedecor_glowlight_cube_yellow_tb.png', |
|
429 |
'technic_homedecor_glowlight_cube_yellow_tb.png', |
|
430 |
'technic_homedecor_glowlight_cube_yellow_sides.png', |
|
431 |
'technic_homedecor_glowlight_cube_yellow_sides.png', |
|
432 |
'technic_homedecor_glowlight_cube_yellow_sides.png', |
|
433 |
'technic_homedecor_glowlight_cube_yellow_sides.png' |
|
434 |
}, |
|
435 |
selection_box = { |
|
436 |
type = "fixed", |
|
437 |
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 } |
|
438 |
}, |
|
439 |
node_box = { |
|
440 |
type = "fixed", |
|
441 |
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 } |
|
442 |
}, |
|
443 |
|
|
444 |
sunlight_propagates = false, |
|
445 |
paramtype = "light", |
|
446 |
paramtype2 = "facedir", |
|
447 |
walkable = true, |
|
448 |
sounds = default.node_sound_wood_defaults(), |
|
449 |
|
|
450 |
groups = { snappy = 3 }, |
|
451 |
on_place = function(itemstack, placer, pointed_thing) |
|
452 |
technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing) |
|
453 |
return itemstack |
|
454 |
end, |
|
455 |
on_construct = function(pos) |
ee5c6c
|
456 |
technic.inductive_on_construct(pos, 50, "Yellow Glowlight (small cube)") |
37d9d9
|
457 |
end, |
K |
458 |
on_punch = function(pos, node, puncher) |
ee5c6c
|
459 |
technic.inductive_on_punch_off(pos, 50, "technic:homedecor_glowlight_small_cube_yellow_active") |
37d9d9
|
460 |
end |
K |
461 |
}) |
|
462 |
|
|
463 |
minetest.register_node('technic:homedecor_glowlight_small_cube_yellow_active', { |
|
464 |
description = S("Yellow Glowlight (small cube)"), |
|
465 |
drawtype = "nodebox", |
|
466 |
tiles = { |
|
467 |
'technic_homedecor_glowlight_cube_yellow_tb.png', |
|
468 |
'technic_homedecor_glowlight_cube_yellow_tb.png', |
|
469 |
'technic_homedecor_glowlight_cube_yellow_sides.png', |
|
470 |
'technic_homedecor_glowlight_cube_yellow_sides.png', |
|
471 |
'technic_homedecor_glowlight_cube_yellow_sides.png', |
|
472 |
'technic_homedecor_glowlight_cube_yellow_sides.png' |
|
473 |
}, |
|
474 |
selection_box = { |
|
475 |
type = "fixed", |
|
476 |
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 } |
|
477 |
}, |
|
478 |
node_box = { |
|
479 |
type = "fixed", |
|
480 |
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 } |
|
481 |
}, |
|
482 |
|
|
483 |
sunlight_propagates = false, |
|
484 |
paramtype = "light", |
|
485 |
paramtype2 = "facedir", |
|
486 |
walkable = true, |
|
487 |
light_source = LIGHT_MAX-1, |
|
488 |
sounds = default.node_sound_wood_defaults(), |
|
489 |
|
|
490 |
groups = { snappy = 3, not_in_creative_inventory=1}, |
e64994
|
491 |
drop="technic:homedecor_glowlight_small_cube_yellow", |
37d9d9
|
492 |
on_place = function(itemstack, placer, pointed_thing) |
K |
493 |
technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing) |
|
494 |
return itemstack |
|
495 |
end, |
|
496 |
on_construct = function(pos) |
ee5c6c
|
497 |
technic.inductive_on_construct(pos, 50, "Yellow Glowlight (small cube)") |
37d9d9
|
498 |
end, |
K |
499 |
on_punch = function(pos, node, puncher) |
ee5c6c
|
500 |
technic.inductive_on_punch_on(pos, 0, "technic:homedecor_glowlight_small_cube_yellow") |
37d9d9
|
501 |
end |
K |
502 |
}) |
|
503 |
|
|
504 |
-- Glowlight "cubes" - white |
|
505 |
minetest.register_node('technic:homedecor_glowlight_small_cube_white', { |
|
506 |
description = S("White Glowlight (small cube)"), |
|
507 |
drawtype = "nodebox", |
|
508 |
tiles = { |
|
509 |
'technic_homedecor_glowlight_cube_white_tb.png', |
|
510 |
'technic_homedecor_glowlight_cube_white_tb.png', |
|
511 |
'technic_homedecor_glowlight_cube_white_sides.png', |
|
512 |
'technic_homedecor_glowlight_cube_white_sides.png', |
|
513 |
'technic_homedecor_glowlight_cube_white_sides.png', |
|
514 |
'technic_homedecor_glowlight_cube_white_sides.png' |
|
515 |
}, |
|
516 |
selection_box = { |
|
517 |
type = "fixed", |
|
518 |
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 } |
|
519 |
}, |
|
520 |
node_box = { |
|
521 |
type = "fixed", |
|
522 |
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 } |
|
523 |
}, |
|
524 |
|
|
525 |
sunlight_propagates = false, |
|
526 |
paramtype = "light", |
|
527 |
paramtype2 = "facedir", |
|
528 |
walkable = true, |
|
529 |
sounds = default.node_sound_wood_defaults(), |
|
530 |
|
|
531 |
groups = { snappy = 3 }, |
|
532 |
on_place = function(itemstack, placer, pointed_thing) |
|
533 |
technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing) |
|
534 |
return itemstack |
|
535 |
end, |
|
536 |
on_construct = function(pos) |
ee5c6c
|
537 |
technic.inductive_on_construct(pos, 50, "White Glowlight (small cube)") |
37d9d9
|
538 |
end, |
K |
539 |
on_punch = function(pos, node, puncher) |
ee5c6c
|
540 |
technic.inductive_on_punch_off(pos, 50, "technic:homedecor_glowlight_small_cube_white_active") |
37d9d9
|
541 |
end |
K |
542 |
}) |
|
543 |
|
|
544 |
minetest.register_node('technic:homedecor_glowlight_small_cube_white_active', { |
|
545 |
description = S("White Glowlight (small cube)"), |
|
546 |
drawtype = "nodebox", |
|
547 |
tiles = { |
|
548 |
'technic_homedecor_glowlight_cube_white_tb.png', |
|
549 |
'technic_homedecor_glowlight_cube_white_tb.png', |
|
550 |
'technic_homedecor_glowlight_cube_white_sides.png', |
|
551 |
'technic_homedecor_glowlight_cube_white_sides.png', |
|
552 |
'technic_homedecor_glowlight_cube_white_sides.png', |
|
553 |
'technic_homedecor_glowlight_cube_white_sides.png' |
|
554 |
}, |
|
555 |
selection_box = { |
|
556 |
type = "fixed", |
|
557 |
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 } |
|
558 |
}, |
|
559 |
node_box = { |
|
560 |
type = "fixed", |
|
561 |
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 } |
|
562 |
}, |
|
563 |
|
|
564 |
sunlight_propagates = false, |
|
565 |
paramtype = "light", |
|
566 |
paramtype2 = "facedir", |
|
567 |
walkable = true, |
|
568 |
light_source = LIGHT_MAX-1, |
|
569 |
sounds = default.node_sound_wood_defaults(), |
|
570 |
|
|
571 |
groups = { snappy = 3, not_in_creative_inventory=1}, |
e64994
|
572 |
drop="technic:homedecor_glowlight_small_cube_white", |
37d9d9
|
573 |
on_place = function(itemstack, placer, pointed_thing) |
K |
574 |
technic_homedecor_rotate_and_place(itemstack, placer, pointed_thing) |
|
575 |
return itemstack |
|
576 |
end, |
|
577 |
on_construct = function(pos) |
ee5c6c
|
578 |
technic.inductive_on_construct(pos, 50, "White Glowlight (small cube)") |
37d9d9
|
579 |
end, |
K |
580 |
on_punch = function(pos, node, puncher) |
ee5c6c
|
581 |
technic.inductive_on_punch_on(pos, 0, "technic:homedecor_glowlight_small_cube_white") |
37d9d9
|
582 |
end |
K |
583 |
}) |
|
584 |
|
ee5c6c
|
585 |
technic.register_inductive_machine("technic:homedecor_glowlight_half_yellow") |
K |
586 |
technic.register_inductive_machine("technic:homedecor_glowlight_half_white") |
|
587 |
technic.register_inductive_machine("technic:homedecor_glowlight_quarter_yellow") |
|
588 |
technic.register_inductive_machine("technic:homedecor_glowlight_quarter_white") |
|
589 |
technic.register_inductive_machine("technic:homedecor_glowlight_small_cube_yellow") |
|
590 |
technic.register_inductive_machine("technic:homedecor_glowlight_small_cube_white") |