2012-10-02 01:22:54 +02:00
|
|
|
|
|
|
|
-- This file supplies glowlights
|
|
|
|
|
2013-10-22 02:31:54 +02:00
|
|
|
local S = homedecor.gettext
|
2013-03-05 08:18:56 +01:00
|
|
|
|
2013-04-24 18:30:21 +02:00
|
|
|
local colors = {"yellow","white"}
|
|
|
|
|
|
|
|
for i in ipairs(colors) do
|
|
|
|
local color = colors[i]
|
|
|
|
|
|
|
|
minetest.register_abm({
|
|
|
|
nodenames = { "homedecor:glowlight_thin_"..color },
|
|
|
|
interval = 1,
|
|
|
|
chance = 1,
|
|
|
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
2013-07-01 05:55:07 +02:00
|
|
|
minetest.add_node(pos, {name = "homedecor:glowlight_quarter_"..color, param2 = 20})
|
2013-04-24 18:30:21 +02:00
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_abm({
|
|
|
|
nodenames = { "homedecor:glowlight_thick_"..color },
|
|
|
|
interval = 1,
|
|
|
|
chance = 1,
|
|
|
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
2013-07-01 05:55:07 +02:00
|
|
|
minetest.add_node(pos, {name = "homedecor:glowlight_half_"..color, param2 = 20})
|
2013-04-24 18:30:21 +02:00
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_abm({
|
|
|
|
nodenames = { "homedecor:glowlight_thin_"..color.."_wall" },
|
|
|
|
interval = 1,
|
|
|
|
chance = 1,
|
|
|
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
|
|
|
local fdir = node.param2 or 0
|
|
|
|
nfdir = dirs2[fdir+1]
|
2013-07-01 05:55:07 +02:00
|
|
|
minetest.add_node(pos, {name = "homedecor:glowlight_quarter_"..color, param2 = nfdir})
|
2013-04-24 18:30:21 +02:00
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_abm({
|
|
|
|
nodenames = { "homedecor:glowlight_thick_"..color.."_wall" },
|
|
|
|
interval = 1,
|
|
|
|
chance = 1,
|
|
|
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
|
|
|
local fdir = node.param2 or 0
|
|
|
|
nfdir = dirs2[fdir+1]
|
2013-07-01 05:55:07 +02:00
|
|
|
minetest.add_node(pos, {name = "homedecor:glowlight_half_"..color, param2 = nfdir})
|
2013-04-24 18:30:21 +02:00
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_abm({
|
|
|
|
nodenames = { "homedecor:glowlight_small_cube_"..color.."_ceiling" },
|
|
|
|
interval = 1,
|
|
|
|
chance = 1,
|
|
|
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
2013-07-01 05:55:07 +02:00
|
|
|
minetest.add_node(pos, {name = "homedecor:glowlight_small_cube_"..color, param2 = 20})
|
2013-04-24 18:30:21 +02:00
|
|
|
end,
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2012-10-02 01:22:54 +02:00
|
|
|
-- Yellow
|
|
|
|
|
2013-04-24 18:30:21 +02:00
|
|
|
minetest.register_node('homedecor:glowlight_half_yellow', {
|
2013-03-05 08:18:56 +01:00
|
|
|
description = S("Yellow Glowlight (thick)"),
|
2012-10-02 01:22:54 +02:00
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {
|
2013-07-01 06:51:18 +02:00
|
|
|
'homedecor_glowlight_yellow_top.png',
|
|
|
|
'homedecor_glowlight_yellow_bottom.png',
|
2012-10-02 01:22:54 +02:00
|
|
|
'homedecor_glowlight_thick_yellow_sides.png',
|
|
|
|
'homedecor_glowlight_thick_yellow_sides.png',
|
|
|
|
'homedecor_glowlight_thick_yellow_sides.png',
|
|
|
|
'homedecor_glowlight_thick_yellow_sides.png'
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
2013-04-24 18:30:21 +02:00
|
|
|
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }
|
2012-10-02 01:22:54 +02:00
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
2013-04-24 18:30:21 +02:00
|
|
|
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }
|
2012-10-02 01:22:54 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
sunlight_propagates = false,
|
|
|
|
paramtype = "light",
|
2013-04-24 18:30:21 +02:00
|
|
|
paramtype2 = "facedir",
|
2012-10-02 01:22:54 +02:00
|
|
|
walkable = true,
|
|
|
|
groups = { snappy = 3 },
|
|
|
|
light_source = LIGHT_MAX,
|
2013-03-17 00:46:30 +01:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2013-04-14 21:45:21 +02:00
|
|
|
|
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
2013-10-13 19:20:42 +02:00
|
|
|
if not homedecor:node_is_owned(pointed_thing.under, placer)
|
|
|
|
and not homedecor:node_is_owned(pointed_thing.above, placer) then
|
|
|
|
lib_6d:rotate_and_place(itemstack, placer, pointed_thing, homedecor.expect_infinite_stacks)
|
|
|
|
end
|
2013-06-07 19:15:54 +02:00
|
|
|
return itemstack
|
2013-04-14 21:45:21 +02:00
|
|
|
end
|
2012-10-02 01:22:54 +02:00
|
|
|
})
|
|
|
|
|
2013-04-24 18:30:21 +02:00
|
|
|
minetest.register_node('homedecor:glowlight_quarter_yellow', {
|
2013-03-05 08:18:56 +01:00
|
|
|
description = S("Yellow Glowlight (thin)"),
|
2012-10-02 01:22:54 +02:00
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {
|
2013-07-01 06:51:18 +02:00
|
|
|
'homedecor_glowlight_yellow_top.png',
|
|
|
|
'homedecor_glowlight_yellow_bottom.png',
|
2012-10-02 01:22:54 +02:00
|
|
|
'homedecor_glowlight_thin_yellow_sides.png',
|
|
|
|
'homedecor_glowlight_thin_yellow_sides.png',
|
|
|
|
'homedecor_glowlight_thin_yellow_sides.png',
|
|
|
|
'homedecor_glowlight_thin_yellow_sides.png'
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
2013-04-24 18:30:21 +02:00
|
|
|
fixed = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 }
|
2012-10-02 01:22:54 +02:00
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
2013-04-24 18:30:21 +02:00
|
|
|
fixed = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 }
|
2012-10-02 01:22:54 +02:00
|
|
|
},
|
|
|
|
|
2012-10-04 00:53:17 +02:00
|
|
|
sunlight_propagates = false,
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
walkable = true,
|
2012-10-02 01:22:54 +02:00
|
|
|
groups = { snappy = 3 },
|
|
|
|
light_source = LIGHT_MAX-1,
|
2013-03-17 00:46:30 +01:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2013-04-14 21:45:21 +02:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
2013-10-13 19:20:42 +02:00
|
|
|
if not homedecor:node_is_owned(pointed_thing.under, placer)
|
|
|
|
and not homedecor:node_is_owned(pointed_thing.above, placer) then
|
|
|
|
lib_6d:rotate_and_place(itemstack, placer, pointed_thing, homedecor.expect_infinite_stacks)
|
|
|
|
end
|
2013-06-07 19:15:54 +02:00
|
|
|
return itemstack
|
2013-04-14 21:45:21 +02:00
|
|
|
end
|
2012-10-02 01:22:54 +02:00
|
|
|
})
|
|
|
|
|
2013-04-14 22:22:08 +02:00
|
|
|
|
2012-10-02 03:06:10 +02:00
|
|
|
|
2012-10-02 01:22:54 +02:00
|
|
|
-- White
|
|
|
|
|
2013-04-24 18:30:21 +02:00
|
|
|
minetest.register_node('homedecor:glowlight_half_white', {
|
2013-03-05 08:18:56 +01:00
|
|
|
description = S("White Glowlight (thick)"),
|
2012-10-02 01:22:54 +02:00
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {
|
2013-07-01 06:51:18 +02:00
|
|
|
'homedecor_glowlight_white_top.png',
|
|
|
|
'homedecor_glowlight_white_bottom.png',
|
2012-10-02 01:22:54 +02:00
|
|
|
'homedecor_glowlight_thick_white_sides.png',
|
|
|
|
'homedecor_glowlight_thick_white_sides.png',
|
|
|
|
'homedecor_glowlight_thick_white_sides.png',
|
|
|
|
'homedecor_glowlight_thick_white_sides.png'
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
2013-04-24 18:30:21 +02:00
|
|
|
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }
|
2012-10-02 01:22:54 +02:00
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
2013-04-24 18:30:21 +02:00
|
|
|
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }
|
2012-10-02 01:22:54 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
sunlight_propagates = false,
|
|
|
|
paramtype = "light",
|
2013-04-24 18:30:21 +02:00
|
|
|
paramtype2 = "facedir",
|
2012-10-02 01:22:54 +02:00
|
|
|
walkable = true,
|
|
|
|
groups = { snappy = 3 },
|
|
|
|
light_source = LIGHT_MAX,
|
2013-03-17 00:46:30 +01:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2013-04-14 21:45:21 +02:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
2013-10-13 19:20:42 +02:00
|
|
|
if not homedecor:node_is_owned(pointed_thing.under, placer)
|
|
|
|
and not homedecor:node_is_owned(pointed_thing.above, placer) then
|
|
|
|
lib_6d:rotate_and_place(itemstack, placer, pointed_thing, homedecor.expect_infinite_stacks)
|
|
|
|
end
|
2013-06-07 19:15:54 +02:00
|
|
|
return itemstack
|
2013-04-14 21:45:21 +02:00
|
|
|
end
|
2012-10-02 01:22:54 +02:00
|
|
|
})
|
|
|
|
|
2013-04-24 18:30:21 +02:00
|
|
|
minetest.register_node('homedecor:glowlight_quarter_white', {
|
2013-03-05 08:18:56 +01:00
|
|
|
description = S("White Glowlight (thin)"),
|
2012-10-02 01:22:54 +02:00
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {
|
2013-07-01 06:51:18 +02:00
|
|
|
'homedecor_glowlight_white_top.png',
|
|
|
|
'homedecor_glowlight_white_bottom.png',
|
2012-10-02 01:22:54 +02:00
|
|
|
'homedecor_glowlight_thin_white_sides.png',
|
|
|
|
'homedecor_glowlight_thin_white_sides.png',
|
|
|
|
'homedecor_glowlight_thin_white_sides.png',
|
|
|
|
'homedecor_glowlight_thin_white_sides.png'
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
2013-04-24 18:30:21 +02:00
|
|
|
fixed = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 }
|
2012-10-02 01:22:54 +02:00
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
2013-04-24 18:30:21 +02:00
|
|
|
fixed = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 }
|
2012-10-02 01:22:54 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
sunlight_propagates = false,
|
|
|
|
paramtype = "light",
|
2013-04-24 18:30:21 +02:00
|
|
|
paramtype2 = "facedir",
|
2012-10-02 01:22:54 +02:00
|
|
|
walkable = true,
|
|
|
|
groups = { snappy = 3 },
|
|
|
|
light_source = LIGHT_MAX-1,
|
2013-03-17 00:46:30 +01:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2013-04-14 21:45:21 +02:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
2013-10-13 19:20:42 +02:00
|
|
|
if not homedecor:node_is_owned(pointed_thing.under, placer)
|
|
|
|
and not homedecor:node_is_owned(pointed_thing.above, placer) then
|
|
|
|
lib_6d:rotate_and_place(itemstack, placer, pointed_thing, homedecor.expect_infinite_stacks)
|
|
|
|
end
|
2013-06-07 19:15:54 +02:00
|
|
|
return itemstack
|
2013-04-14 21:45:21 +02:00
|
|
|
end
|
2012-10-02 01:22:54 +02:00
|
|
|
})
|
|
|
|
|
2013-04-24 18:30:21 +02:00
|
|
|
-- Glowlight "cubes"
|
|
|
|
|
|
|
|
minetest.register_node('homedecor:glowlight_small_cube_yellow', {
|
|
|
|
description = S("Yellow Glowlight (small cube)"),
|
2012-10-04 00:53:17 +02:00
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {
|
2013-04-24 18:30:21 +02:00
|
|
|
'homedecor_glowlight_cube_yellow_tb.png',
|
|
|
|
'homedecor_glowlight_cube_yellow_tb.png',
|
|
|
|
'homedecor_glowlight_cube_yellow_sides.png',
|
|
|
|
'homedecor_glowlight_cube_yellow_sides.png',
|
|
|
|
'homedecor_glowlight_cube_yellow_sides.png',
|
|
|
|
'homedecor_glowlight_cube_yellow_sides.png'
|
2012-10-04 00:53:17 +02:00
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
2013-04-24 18:30:21 +02:00
|
|
|
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 }
|
2012-10-04 00:53:17 +02:00
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
2013-04-24 18:30:21 +02:00
|
|
|
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 }
|
2012-10-04 00:53:17 +02:00
|
|
|
},
|
2013-04-24 18:30:21 +02:00
|
|
|
|
2012-10-04 00:53:17 +02:00
|
|
|
sunlight_propagates = false,
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
walkable = true,
|
2013-04-24 18:30:21 +02:00
|
|
|
groups = { snappy = 3 },
|
2012-10-04 00:53:17 +02:00
|
|
|
light_source = LIGHT_MAX-1,
|
2013-03-17 00:46:30 +01:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2013-04-14 22:22:08 +02:00
|
|
|
|
2013-04-24 18:30:21 +02:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
2013-10-13 19:20:42 +02:00
|
|
|
if not homedecor:node_is_owned(pointed_thing.under, placer)
|
|
|
|
and not homedecor:node_is_owned(pointed_thing.above, placer) then
|
|
|
|
lib_6d:rotate_and_place(itemstack, placer, pointed_thing, homedecor.expect_infinite_stacks)
|
|
|
|
end
|
2013-06-07 19:15:54 +02:00
|
|
|
return itemstack
|
2013-04-24 18:30:21 +02:00
|
|
|
end
|
2012-10-04 00:53:17 +02:00
|
|
|
})
|
|
|
|
|
2012-10-02 01:22:54 +02:00
|
|
|
minetest.register_node('homedecor:glowlight_small_cube_white', {
|
2013-03-05 08:18:56 +01:00
|
|
|
description = S("White Glowlight (small cube)"),
|
2012-10-02 01:22:54 +02:00
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {
|
|
|
|
'homedecor_glowlight_cube_white_tb.png',
|
|
|
|
'homedecor_glowlight_cube_white_tb.png',
|
|
|
|
'homedecor_glowlight_cube_white_sides.png',
|
|
|
|
'homedecor_glowlight_cube_white_sides.png',
|
|
|
|
'homedecor_glowlight_cube_white_sides.png',
|
|
|
|
'homedecor_glowlight_cube_white_sides.png'
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 }
|
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 }
|
|
|
|
},
|
|
|
|
|
|
|
|
sunlight_propagates = false,
|
|
|
|
paramtype = "light",
|
2013-04-24 18:30:21 +02:00
|
|
|
paramtype2 = "facedir",
|
2012-10-02 01:22:54 +02:00
|
|
|
walkable = true,
|
|
|
|
groups = { snappy = 3 },
|
|
|
|
light_source = LIGHT_MAX-1,
|
2013-03-17 00:46:30 +01:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2013-04-14 21:45:21 +02:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
2013-10-13 19:20:42 +02:00
|
|
|
if not homedecor:node_is_owned(pointed_thing.under, placer)
|
|
|
|
and not homedecor:node_is_owned(pointed_thing.above, placer) then
|
|
|
|
lib_6d:rotate_and_place(itemstack, placer, pointed_thing, homedecor.expect_infinite_stacks)
|
|
|
|
end
|
2013-06-07 19:15:54 +02:00
|
|
|
return itemstack
|
2013-04-14 21:45:21 +02:00
|
|
|
end
|
2012-10-02 01:22:54 +02:00
|
|
|
})
|
2012-10-02 03:06:10 +02:00
|
|
|
|