2012-10-02 01:22:54 +02:00
|
|
|
-- This file supplies glowlights
|
|
|
|
|
2017-01-30 00:12:02 +01:00
|
|
|
local S = homedecor_i18n.gettext
|
2013-03-05 08:18:56 +01:00
|
|
|
|
2017-01-29 06:58:31 +01:00
|
|
|
local glowlight_nodebox = {
|
|
|
|
half = homedecor.nodebox.slab_y(1/2),
|
|
|
|
quarter = homedecor.nodebox.slab_y(1/4),
|
|
|
|
small_cube = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 }
|
|
|
|
},
|
|
|
|
}
|
2013-04-24 18:30:21 +02:00
|
|
|
|
2017-01-29 09:31:02 +01:00
|
|
|
minetest.register_node("homedecor:glowlight_half", {
|
2017-01-29 06:58:31 +01:00
|
|
|
description = S("Thick Glowlight"),
|
|
|
|
tiles = {
|
|
|
|
"homedecor_glowlight_top.png",
|
|
|
|
"homedecor_glowlight_bottom.png",
|
|
|
|
"homedecor_glowlight_thick_sides.png",
|
|
|
|
"homedecor_glowlight_thick_sides.png",
|
|
|
|
"homedecor_glowlight_thick_sides.png",
|
|
|
|
"homedecor_glowlight_thick_sides.png"
|
|
|
|
},
|
2017-06-16 22:01:22 +02:00
|
|
|
overlay_tiles = {
|
|
|
|
{ name = "homedecor_glowlight_top_overlay.png", color = "white"},
|
|
|
|
"",
|
|
|
|
{ name = "homedecor_glowlight_thick_sides_overlay.png", color = "white"},
|
|
|
|
{ name = "homedecor_glowlight_thick_sides_overlay.png", color = "white"},
|
|
|
|
{ name = "homedecor_glowlight_thick_sides_overlay.png", color = "white"},
|
|
|
|
{ name = "homedecor_glowlight_thick_sides_overlay.png", color = "white"},
|
|
|
|
},
|
|
|
|
use_texture_alpha = true,
|
2017-01-29 09:31:02 +01:00
|
|
|
drawtype = "nodebox",
|
|
|
|
paramtype = "light",
|
2017-01-29 06:58:31 +01:00
|
|
|
paramtype2 = "colorwallmounted",
|
|
|
|
palette = "unifieddyes_palette_colorwallmounted.png",
|
2017-01-29 09:31:02 +01:00
|
|
|
selection_box = {
|
|
|
|
type = "wallmounted",
|
|
|
|
wall_top = { -0.5, 0, -0.5, 0.5, 0.5, 0.5 },
|
|
|
|
wall_bottom = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 },
|
|
|
|
wall_side = { -0.5, -0.5, -0.5, 0, 0.5, 0.5 }
|
|
|
|
},
|
2017-01-29 06:58:31 +01:00
|
|
|
node_box = glowlight_nodebox.half,
|
2017-02-05 01:41:36 +01:00
|
|
|
groups = { snappy = 3, ud_param2_colorable = 1 },
|
2017-01-29 06:58:31 +01:00
|
|
|
light_source = default.LIGHT_MAX,
|
|
|
|
sounds = default.node_sound_glass_defaults(),
|
2017-03-18 10:51:46 +01:00
|
|
|
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
|
|
|
unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
|
|
|
|
end,
|
2017-01-29 06:58:31 +01:00
|
|
|
})
|
2013-04-24 18:30:21 +02:00
|
|
|
|
2017-01-29 09:31:02 +01:00
|
|
|
minetest.register_node("homedecor:glowlight_quarter", {
|
2017-01-29 06:58:31 +01:00
|
|
|
description = S("Thin Glowlight"),
|
|
|
|
tiles = {
|
|
|
|
"homedecor_glowlight_top.png",
|
|
|
|
"homedecor_glowlight_bottom.png",
|
|
|
|
"homedecor_glowlight_thin_sides.png",
|
|
|
|
"homedecor_glowlight_thin_sides.png",
|
|
|
|
"homedecor_glowlight_thin_sides.png",
|
|
|
|
"homedecor_glowlight_thin_sides.png"
|
|
|
|
},
|
2017-06-16 22:01:22 +02:00
|
|
|
overlay_tiles = {
|
|
|
|
{ name = "homedecor_glowlight_top_overlay.png", color = "white"},
|
|
|
|
"",
|
|
|
|
{ name = "homedecor_glowlight_thin_sides_overlay.png", color = "white"},
|
|
|
|
{ name = "homedecor_glowlight_thin_sides_overlay.png", color = "white"},
|
|
|
|
{ name = "homedecor_glowlight_thin_sides_overlay.png", color = "white"},
|
|
|
|
{ name = "homedecor_glowlight_thin_sides_overlay.png", color = "white"},
|
|
|
|
},
|
|
|
|
use_texture_alpha = true,
|
2017-01-29 09:31:02 +01:00
|
|
|
drawtype = "nodebox",
|
|
|
|
paramtype = "light",
|
2017-01-29 06:58:31 +01:00
|
|
|
paramtype2 = "colorwallmounted",
|
|
|
|
palette = "unifieddyes_palette_colorwallmounted.png",
|
2017-01-29 09:31:02 +01:00
|
|
|
selection_box = {
|
|
|
|
type = "wallmounted",
|
|
|
|
wall_top = { -0.5, 0.25, -0.5, 0.5, 0.5, 0.5 },
|
|
|
|
wall_bottom = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 },
|
|
|
|
wall_side = { -0.5, -0.5, -0.5, -0.25, 0.5, 0.5 }
|
|
|
|
},
|
2017-01-29 06:58:31 +01:00
|
|
|
node_box = glowlight_nodebox.quarter,
|
2017-02-05 01:41:36 +01:00
|
|
|
groups = { snappy = 3, ud_param2_colorable = 1 },
|
2017-01-29 06:58:31 +01:00
|
|
|
light_source = default.LIGHT_MAX-1,
|
|
|
|
sounds = default.node_sound_glass_defaults(),
|
2017-03-18 10:51:46 +01:00
|
|
|
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
|
|
|
unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
|
|
|
|
end,
|
2017-01-29 06:58:31 +01:00
|
|
|
})
|
2017-01-29 04:11:18 +01:00
|
|
|
|
2017-01-29 09:31:02 +01:00
|
|
|
minetest.register_node("homedecor:glowlight_small_cube", {
|
2017-01-29 06:58:31 +01:00
|
|
|
description = S("Small Glowlight Cube"),
|
|
|
|
tiles = {
|
|
|
|
"homedecor_glowlight_cube_tb.png",
|
|
|
|
"homedecor_glowlight_cube_tb.png",
|
|
|
|
"homedecor_glowlight_cube_sides.png",
|
|
|
|
"homedecor_glowlight_cube_sides.png",
|
|
|
|
"homedecor_glowlight_cube_sides.png",
|
|
|
|
"homedecor_glowlight_cube_sides.png"
|
|
|
|
},
|
2017-06-16 22:01:22 +02:00
|
|
|
overlay_tiles = {
|
|
|
|
{ name = "homedecor_glowlight_cube_tb_overlay.png", color = "white"},
|
|
|
|
{ name = "homedecor_glowlight_cube_tb_overlay.png", color = "white"},
|
|
|
|
{ name = "homedecor_glowlight_cube_sides_overlay.png", color = "white"},
|
|
|
|
{ name = "homedecor_glowlight_cube_sides_overlay.png", color = "white"},
|
|
|
|
{ name = "homedecor_glowlight_cube_sides_overlay.png", color = "white"},
|
|
|
|
{ name = "homedecor_glowlight_cube_sides_overlay.png", color = "white"},
|
|
|
|
},
|
|
|
|
use_texture_alpha = true,
|
2017-01-29 09:31:02 +01:00
|
|
|
paramtype = "light",
|
2017-01-29 06:58:31 +01:00
|
|
|
paramtype2 = "colorwallmounted",
|
2017-01-29 09:31:02 +01:00
|
|
|
drawtype = "nodebox",
|
2017-01-29 06:58:31 +01:00
|
|
|
palette = "unifieddyes_palette_colorwallmounted.png",
|
2017-01-29 09:31:02 +01:00
|
|
|
selection_box = {
|
|
|
|
type = "wallmounted",
|
|
|
|
wall_top = { -0.25, 0, -0.25, 0.25, 0.5, 0.25 },
|
|
|
|
wall_bottom = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 },
|
|
|
|
wall_side = { -0.5, -0.25, -0.25, 0, 0.25, 0.25 }
|
|
|
|
},
|
2017-01-29 06:58:31 +01:00
|
|
|
node_box = glowlight_nodebox.small_cube,
|
2017-02-05 01:41:36 +01:00
|
|
|
groups = { snappy = 3, ud_param2_colorable = 1 },
|
2017-01-29 06:58:31 +01:00
|
|
|
light_source = default.LIGHT_MAX-1,
|
|
|
|
sounds = default.node_sound_glass_defaults(),
|
2017-03-18 10:51:46 +01:00
|
|
|
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
|
|
|
unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
|
|
|
|
end,
|
2017-01-29 06:58:31 +01:00
|
|
|
})
|
2013-04-24 18:30:21 +02:00
|
|
|
|
2015-01-24 00:34:02 +01:00
|
|
|
homedecor.register("plasma_lamp", {
|
2017-01-24 21:43:20 +01:00
|
|
|
description = S("Plasma Lamp"),
|
2017-06-15 19:42:44 +02:00
|
|
|
drawtype = "mesh",
|
|
|
|
mesh = "plasma_lamp.obj",
|
|
|
|
tiles = {
|
|
|
|
"default_gold_block.png",
|
2014-06-29 18:49:35 +02:00
|
|
|
{
|
|
|
|
name="homedecor_plasma_storm.png",
|
|
|
|
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0},
|
|
|
|
}
|
|
|
|
},
|
2015-05-08 04:22:39 +02:00
|
|
|
use_texture_alpha = true,
|
2015-08-01 15:08:48 +02:00
|
|
|
light_source = default.LIGHT_MAX - 1,
|
2014-06-29 18:49:35 +02:00
|
|
|
sunlight_propagates = true,
|
|
|
|
groups = {cracky=3,oddly_breakable_by_hand=3},
|
|
|
|
sounds = default.node_sound_glass_defaults(),
|
|
|
|
})
|
|
|
|
|
2015-05-08 04:22:39 +02:00
|
|
|
homedecor.register("plasma_ball", {
|
2017-01-24 21:43:20 +01:00
|
|
|
description = S("Plasma Ball"),
|
2015-05-08 04:22:39 +02:00
|
|
|
mesh = "homedecor_plasma_ball.obj",
|
|
|
|
tiles = {
|
2017-06-15 19:11:01 +02:00
|
|
|
{ name = "homedecor_generic_plastic.png", color = homedecor.color_black },
|
2015-05-08 04:22:39 +02:00
|
|
|
{
|
|
|
|
name = "homedecor_plasma_ball_streamers.png",
|
|
|
|
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0},
|
|
|
|
},
|
2015-05-09 05:21:57 +02:00
|
|
|
"homedecor_plasma_ball_glass.png"
|
2015-05-08 04:22:39 +02:00
|
|
|
},
|
2015-05-08 05:25:29 +02:00
|
|
|
inventory_image = "homedecor_plasma_ball_inv.png",
|
2016-12-15 22:23:31 +01:00
|
|
|
selection_box = {
|
2015-05-08 04:22:39 +02:00
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.1875, -0.5, -0.1875, 0.1875, 0, 0.1875 }
|
|
|
|
},
|
|
|
|
walkable = false,
|
|
|
|
use_texture_alpha = true,
|
2015-08-01 15:08:48 +02:00
|
|
|
light_source = default.LIGHT_MAX - 5,
|
2015-05-08 04:22:39 +02:00
|
|
|
sunlight_propagates = true,
|
|
|
|
groups = {cracky=3,oddly_breakable_by_hand=3},
|
|
|
|
sounds = default.node_sound_glass_defaults(),
|
|
|
|
})
|
|
|
|
|
2015-04-14 17:58:05 +02:00
|
|
|
local tc_cbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{ -0.1875, -0.5, -0.1875, 0.1875, 0.375, 0.1875 },
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-24 00:34:02 +01:00
|
|
|
homedecor.register("candle", {
|
2014-09-23 14:20:34 +02:00
|
|
|
description = S("Thick Candle"),
|
2015-04-14 17:58:05 +02:00
|
|
|
mesh = "homedecor_candle_thick.obj",
|
2014-07-27 17:52:42 +02:00
|
|
|
tiles = {
|
2015-04-14 17:58:05 +02:00
|
|
|
'homedecor_candle_sides.png',
|
|
|
|
{name="homedecor_candle_flame.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}},
|
2015-01-23 22:14:00 +01:00
|
|
|
},
|
2015-04-17 12:38:21 +02:00
|
|
|
inventory_image = "homedecor_candle_inv.png",
|
2015-04-14 17:58:05 +02:00
|
|
|
selection_box = tc_cbox,
|
2015-04-29 14:14:36 +02:00
|
|
|
walkable = false,
|
2014-07-27 17:52:42 +02:00
|
|
|
groups = { snappy = 3 },
|
2015-08-01 15:08:48 +02:00
|
|
|
light_source = default.LIGHT_MAX-4,
|
2014-07-27 17:52:42 +02:00
|
|
|
})
|
|
|
|
|
2015-04-14 17:58:05 +02:00
|
|
|
local c_cbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
2015-04-22 07:24:43 +02:00
|
|
|
{ -0.125, -0.5, -0.125, 0.125, 0.05, 0.125 },
|
2015-04-14 17:58:05 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-24 00:34:02 +01:00
|
|
|
homedecor.register("candle_thin", {
|
2015-04-22 07:24:43 +02:00
|
|
|
description = S("Thin Candle"),
|
2015-04-14 17:58:05 +02:00
|
|
|
mesh = "homedecor_candle_thin.obj",
|
2014-09-22 08:40:03 +02:00
|
|
|
tiles = {
|
2015-04-14 17:58:05 +02:00
|
|
|
'homedecor_candle_sides.png',
|
|
|
|
{name="homedecor_candle_flame.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}},
|
2015-01-23 22:14:00 +01:00
|
|
|
},
|
2015-04-17 12:38:21 +02:00
|
|
|
inventory_image = "homedecor_candle_thin_inv.png",
|
2015-04-14 17:58:05 +02:00
|
|
|
selection_box = c_cbox,
|
2014-10-17 16:09:37 +02:00
|
|
|
walkable = false,
|
2014-09-22 08:40:03 +02:00
|
|
|
groups = { snappy = 3 },
|
2015-08-01 15:08:48 +02:00
|
|
|
light_source = default.LIGHT_MAX-4,
|
2014-09-22 08:40:03 +02:00
|
|
|
})
|
|
|
|
|
2015-04-22 07:24:43 +02:00
|
|
|
local cs_cbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{ -0.15625, -0.5, -0.15625, 0.15625, 0.3125, 0.15625 },
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
homedecor.register("candlestick_wrought_iron", {
|
|
|
|
description = S("Candlestick (wrought iron)"),
|
|
|
|
mesh = "homedecor_candlestick.obj",
|
|
|
|
tiles = {
|
|
|
|
"homedecor_candle_sides.png",
|
|
|
|
{name="homedecor_candle_flame.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}},
|
2015-04-28 05:48:02 +02:00
|
|
|
"homedecor_generic_metal_wrought_iron.png",
|
2015-04-22 07:24:43 +02:00
|
|
|
},
|
|
|
|
inventory_image = "homedecor_candlestick_wrought_iron_inv.png",
|
|
|
|
selection_box = cs_cbox,
|
|
|
|
walkable = false,
|
|
|
|
groups = { snappy = 3 },
|
2015-08-01 15:08:48 +02:00
|
|
|
light_source = default.LIGHT_MAX-4,
|
2015-04-22 07:24:43 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
homedecor.register("candlestick_brass", {
|
|
|
|
description = S("Candlestick (brass)"),
|
|
|
|
mesh = "homedecor_candlestick.obj",
|
|
|
|
tiles = {
|
|
|
|
"homedecor_candle_sides.png",
|
|
|
|
{name="homedecor_candle_flame.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}},
|
2015-04-28 05:48:02 +02:00
|
|
|
"homedecor_generic_metal_brass.png",
|
2015-04-22 07:24:43 +02:00
|
|
|
},
|
|
|
|
inventory_image = "homedecor_candlestick_brass_inv.png",
|
|
|
|
selection_box = cs_cbox,
|
|
|
|
walkable = false,
|
|
|
|
groups = { snappy = 3 },
|
2015-08-01 15:08:48 +02:00
|
|
|
light_source = default.LIGHT_MAX-4,
|
2015-04-22 07:24:43 +02:00
|
|
|
})
|
|
|
|
|
2015-04-14 19:42:22 +02:00
|
|
|
homedecor.register("wall_sconce", {
|
|
|
|
description = S("Wall sconce"),
|
|
|
|
mesh = "homedecor_wall_sconce.obj",
|
|
|
|
tiles = {
|
|
|
|
'homedecor_candle_sides.png',
|
|
|
|
{name="homedecor_candle_flame.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}},
|
|
|
|
'homedecor_wall_sconce_back.png',
|
2015-04-28 05:48:02 +02:00
|
|
|
'homedecor_generic_metal_wrought_iron.png',
|
2015-04-14 19:42:22 +02:00
|
|
|
},
|
|
|
|
inventory_image = "homedecor_wall_sconce_inv.png",
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.1875, -0.25, 0.3125, 0.1875, 0.25, 0.5 }
|
|
|
|
},
|
|
|
|
walkable = false,
|
|
|
|
groups = { snappy = 3 },
|
2015-08-01 15:08:48 +02:00
|
|
|
light_source = default.LIGHT_MAX-4,
|
2015-04-14 19:42:22 +02:00
|
|
|
})
|
|
|
|
|
2015-04-17 12:11:05 +02:00
|
|
|
local ol_cbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{ -5/16, -8/16, -3/16, 5/16, 4/16, 3/16 },
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-24 00:34:02 +01:00
|
|
|
homedecor.register("oil_lamp", {
|
2015-04-28 17:58:47 +02:00
|
|
|
description = S("Oil lamp (hurricane)"),
|
2015-04-17 08:43:00 +02:00
|
|
|
mesh = "homedecor_oil_lamp.obj",
|
|
|
|
tiles = {
|
2015-04-28 05:48:02 +02:00
|
|
|
"homedecor_generic_metal_brass.png",
|
2017-01-25 10:22:28 +01:00
|
|
|
{ name = "homedecor_generic_metal.png", color = homedecor.color_black },
|
|
|
|
{ name = "homedecor_generic_metal.png", color = 0xffa00000 },
|
2015-05-09 05:15:52 +02:00
|
|
|
"homedecor_oil_lamp_wick.png",
|
2017-01-25 10:22:28 +01:00
|
|
|
{ name = "homedecor_generic_metal.png", color = 0xffa00000 },
|
2015-05-09 05:15:52 +02:00
|
|
|
"homedecor_oil_lamp_glass.png",
|
2015-04-17 08:43:00 +02:00
|
|
|
},
|
2015-05-09 05:15:52 +02:00
|
|
|
use_texture_alpha = true,
|
2015-04-17 08:43:00 +02:00
|
|
|
inventory_image = "homedecor_oil_lamp_inv.png",
|
2015-04-17 12:11:05 +02:00
|
|
|
selection_box = ol_cbox,
|
2015-04-29 14:14:36 +02:00
|
|
|
walkable = false,
|
2014-07-27 17:52:42 +02:00
|
|
|
groups = { snappy = 3 },
|
2015-08-01 15:08:48 +02:00
|
|
|
light_source = default.LIGHT_MAX-3,
|
2015-04-17 12:38:21 +02:00
|
|
|
sounds = default.node_sound_glass_defaults(),
|
2014-07-27 17:52:42 +02:00
|
|
|
})
|
|
|
|
|
2015-04-28 17:58:47 +02:00
|
|
|
homedecor.register("oil_lamp_tabletop", {
|
|
|
|
description = S("Oil Lamp (tabletop)"),
|
|
|
|
mesh = "homedecor_oil_lamp_tabletop.obj",
|
|
|
|
tiles = {"homedecor_oil_lamp_tabletop.png"},
|
|
|
|
inventory_image = "homedecor_oil_lamp_tabletop_inv.png",
|
2015-04-28 18:31:03 +02:00
|
|
|
selection_box = ol_cbox,
|
|
|
|
collision_box = ol_cbox,
|
2015-04-28 17:58:47 +02:00
|
|
|
groups = { snappy = 3 },
|
2015-08-01 15:08:48 +02:00
|
|
|
light_source = default.LIGHT_MAX-3,
|
2015-04-28 17:58:47 +02:00
|
|
|
sounds = default.node_sound_glass_defaults(),
|
|
|
|
})
|
|
|
|
|
2015-02-28 10:14:46 +01:00
|
|
|
local gl_cbox = {
|
2015-02-23 13:56:27 +01:00
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.25, -0.5, -0.25, 0.25, 0.45, 0.25 },
|
|
|
|
}
|
|
|
|
|
2015-02-28 10:14:46 +01:00
|
|
|
minetest.register_alias("homedecor:wall_lantern", "homedecor:ground_lantern")
|
|
|
|
|
|
|
|
homedecor.register("ground_lantern", {
|
|
|
|
description = S("Ground Lantern"),
|
|
|
|
mesh = "homedecor_ground_lantern.obj",
|
2015-05-02 15:59:05 +02:00
|
|
|
tiles = { "homedecor_light.png", "homedecor_generic_metal_wrought_iron.png" },
|
|
|
|
use_texture_alpha = true,
|
2015-02-28 10:14:46 +01:00
|
|
|
inventory_image = "homedecor_ground_lantern_inv.png",
|
|
|
|
wield_image = "homedecor_ground_lantern_inv.png",
|
2015-02-23 13:56:27 +01:00
|
|
|
groups = {snappy=3},
|
|
|
|
light_source = 11,
|
2015-02-28 10:14:46 +01:00
|
|
|
selection_box = gl_cbox,
|
2015-04-29 14:14:36 +02:00
|
|
|
walkable = false
|
2015-02-28 10:14:46 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
local hl_cbox = {
|
|
|
|
type = "fixed",
|
2015-05-02 19:48:15 +02:00
|
|
|
fixed = { -0.25, -0.5, -0.2, 0.25, 0.5, 0.5 },
|
2015-02-28 10:14:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
homedecor.register("hanging_lantern", {
|
|
|
|
description = S("Hanging Lantern"),
|
|
|
|
mesh = "homedecor_hanging_lantern.obj",
|
2015-05-02 19:48:15 +02:00
|
|
|
tiles = { "homedecor_generic_metal_wrought_iron.png", "homedecor_light.png" },
|
2015-05-02 15:59:05 +02:00
|
|
|
use_texture_alpha = true,
|
2015-02-28 10:14:46 +01:00
|
|
|
inventory_image = "homedecor_hanging_lantern_inv.png",
|
|
|
|
wield_image = "homedecor_hanging_lantern_inv.png",
|
|
|
|
groups = {snappy=3},
|
|
|
|
light_source = 11,
|
|
|
|
selection_box = hl_cbox,
|
2015-04-29 14:14:36 +02:00
|
|
|
walkable = false
|
2014-10-16 09:22:58 +02:00
|
|
|
})
|
|
|
|
|
2015-03-29 13:34:56 +02:00
|
|
|
local cl_cbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.35, -0.45, -0.35, 0.35, 0.5, 0.35 }
|
|
|
|
}
|
|
|
|
|
|
|
|
homedecor.register("ceiling_lantern", {
|
|
|
|
drawtype = "mesh",
|
|
|
|
mesh = "homedecor_ceiling_lantern.obj",
|
2015-05-02 15:59:05 +02:00
|
|
|
tiles = { "homedecor_light.png", "homedecor_generic_metal_wrought_iron.png" },
|
|
|
|
use_texture_alpha = true,
|
2015-03-29 13:34:56 +02:00
|
|
|
inventory_image = "homedecor_ceiling_lantern_inv.png",
|
2017-01-31 06:34:41 +01:00
|
|
|
description = S("Ceiling Lantern"),
|
2016-12-15 22:23:31 +01:00
|
|
|
groups = {snappy=3},
|
2015-03-29 13:34:56 +02:00
|
|
|
light_source = 11,
|
|
|
|
selection_box = cl_cbox,
|
2015-04-29 14:14:36 +02:00
|
|
|
walkable = false
|
2015-03-29 13:34:56 +02:00
|
|
|
})
|
|
|
|
|
2018-10-18 13:17:08 +02:00
|
|
|
local sm_light = default.LIGHT_MAX-2
|
|
|
|
|
2018-10-18 12:54:26 +02:00
|
|
|
if minetest.get_modpath("darkage") then
|
|
|
|
minetest.register_alias("homedecor:lattice_lantern_large", "darkage:lamp")
|
2018-10-18 13:17:08 +02:00
|
|
|
sm_light = default.LIGHT_MAX-5
|
2018-10-18 12:54:26 +02:00
|
|
|
else
|
|
|
|
homedecor.register("lattice_lantern_large", {
|
|
|
|
description = S("Lattice lantern (large)"),
|
|
|
|
tiles = { 'homedecor_lattice_lantern_large.png' },
|
|
|
|
groups = { snappy = 3 },
|
|
|
|
light_source = default.LIGHT_MAX,
|
|
|
|
sounds = default.node_sound_glass_defaults(),
|
|
|
|
})
|
|
|
|
end
|
2014-07-27 21:15:47 +02:00
|
|
|
|
2015-01-24 00:34:02 +01:00
|
|
|
homedecor.register("lattice_lantern_small", {
|
2014-07-27 21:15:47 +02:00
|
|
|
description = S("Lattice lantern (small)"),
|
|
|
|
tiles = {
|
|
|
|
'homedecor_lattice_lantern_small_tb.png',
|
|
|
|
'homedecor_lattice_lantern_small_tb.png',
|
|
|
|
'homedecor_lattice_lantern_small_sides.png'
|
|
|
|
},
|
2015-01-23 22:14:00 +01:00
|
|
|
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 }
|
|
|
|
},
|
2014-07-27 21:15:47 +02:00
|
|
|
groups = { snappy = 3 },
|
2018-10-18 13:17:08 +02:00
|
|
|
light_source = sm_light,
|
2015-04-29 14:14:36 +02:00
|
|
|
sounds = default.node_sound_glass_defaults(),
|
2014-07-27 21:15:47 +02:00
|
|
|
on_place = minetest.rotate_node
|
|
|
|
})
|
|
|
|
|
2017-02-01 01:01:47 +01:00
|
|
|
local brightness_tab = {
|
|
|
|
0xffd0d0d0,
|
|
|
|
0xffd8d8d8,
|
|
|
|
0xffe0e0e0,
|
|
|
|
0xffe8e8e8,
|
|
|
|
0xffffffff,
|
|
|
|
}
|
|
|
|
|
|
|
|
-- table lamps and standing lamps
|
|
|
|
|
2017-01-29 06:58:31 +01:00
|
|
|
local repl = {
|
|
|
|
["off"] ="low",
|
|
|
|
["low"] ="med",
|
|
|
|
["med"] ="hi",
|
|
|
|
["hi"] ="max",
|
|
|
|
["max"] ="off",
|
|
|
|
}
|
2015-04-14 21:34:17 +02:00
|
|
|
|
|
|
|
local lamp_colors = {
|
2017-01-29 06:58:31 +01:00
|
|
|
"white",
|
|
|
|
"blue",
|
|
|
|
"green",
|
|
|
|
"pink",
|
|
|
|
"red",
|
|
|
|
"violet",
|
2015-04-14 21:34:17 +02:00
|
|
|
}
|
2014-09-30 16:40:36 +02:00
|
|
|
|
2015-01-03 07:52:39 +01:00
|
|
|
local tlamp_cbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.25, -0.5, -0.25, 0.25, 0.5, 0.25 }
|
|
|
|
}
|
|
|
|
|
|
|
|
local slamp_cbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.25, -0.5, -0.25, 0.25, 1.5, 0.25 }
|
|
|
|
}
|
|
|
|
|
2017-01-29 06:58:31 +01:00
|
|
|
local function reg_lamp(suffix, nxt, light, brightness)
|
|
|
|
|
|
|
|
local wool_brighten = (light or 0) * 15
|
2015-04-14 21:34:17 +02:00
|
|
|
|
2017-01-29 06:58:31 +01:00
|
|
|
homedecor.register("table_lamp_"..suffix, {
|
|
|
|
description = S("Table Lamp"),
|
2015-01-03 07:52:39 +01:00
|
|
|
mesh = "homedecor_table_lamp.obj",
|
2015-04-14 21:34:17 +02:00
|
|
|
tiles = {
|
2017-01-29 06:58:31 +01:00
|
|
|
"wool_grey.png^[colorize:#ffffff:"..wool_brighten,
|
2017-01-25 10:22:28 +01:00
|
|
|
{ name = "homedecor_table_standing_lamp_lightbulb.png", color = brightness_tab[brightness] },
|
2017-01-29 06:58:31 +01:00
|
|
|
{ name = "homedecor_generic_wood_red.png", color = 0xffffffff },
|
2017-01-25 10:22:28 +01:00
|
|
|
{ name = "homedecor_generic_metal.png", color = homedecor.color_black },
|
2015-04-14 21:34:17 +02:00
|
|
|
},
|
2017-01-29 06:58:31 +01:00
|
|
|
inventory_image = "homedecor_table_lamp_foot_inv.png^homedecor_table_lamp_top_inv.png",
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "color",
|
2017-02-25 01:06:17 +01:00
|
|
|
palette = "unifieddyes_palette_extended.png",
|
2015-01-03 07:52:39 +01:00
|
|
|
walkable = false,
|
|
|
|
light_source = light,
|
|
|
|
selection_box = tlamp_cbox,
|
2015-04-29 14:14:36 +02:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2017-02-05 01:41:36 +01:00
|
|
|
groups = {cracky=2,oddly_breakable_by_hand=1, ud_param2_colorable = 1,
|
2015-01-03 07:52:39 +01:00
|
|
|
not_in_creative_inventory=((light ~= nil) and 1) or nil,
|
2014-09-30 16:40:36 +02:00
|
|
|
},
|
2017-02-05 01:41:36 +01:00
|
|
|
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
2017-01-29 06:58:31 +01:00
|
|
|
node.name = "homedecor:table_lamp_"..repl[suffix]
|
2015-01-03 07:52:39 +01:00
|
|
|
minetest.set_node(pos, node)
|
|
|
|
end,
|
2017-03-14 07:13:17 +01:00
|
|
|
on_construct = unifieddyes.on_construct,
|
2018-08-22 11:08:48 +02:00
|
|
|
drop = {
|
|
|
|
items = {
|
|
|
|
{items = {"homedecor:table_lamp_off"}, inherit_color = true },
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-30 16:40:36 +02:00
|
|
|
})
|
|
|
|
|
2017-01-29 06:58:31 +01:00
|
|
|
homedecor.register("standing_lamp_"..suffix, {
|
|
|
|
description = S("Standing Lamp"),
|
2015-01-03 07:52:39 +01:00
|
|
|
mesh = "homedecor_standing_lamp.obj",
|
2015-04-14 21:34:17 +02:00
|
|
|
tiles = {
|
2017-01-29 06:58:31 +01:00
|
|
|
"wool_grey.png^[colorize:#ffffff:"..wool_brighten,
|
2017-01-25 10:22:28 +01:00
|
|
|
{ name = "homedecor_table_standing_lamp_lightbulb.png", color = brightness_tab[brightness] },
|
2017-01-29 06:58:31 +01:00
|
|
|
{ name = "homedecor_generic_wood_red.png", color = 0xffffffff },
|
|
|
|
{ name = "homedecor_generic_metal.png", color = homedecor.color_black },
|
2015-04-14 21:34:17 +02:00
|
|
|
},
|
2017-01-29 06:58:31 +01:00
|
|
|
inventory_image = "homedecor_standing_lamp_foot_inv.png^homedecor_standing_lamp_top_inv.png",
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "color",
|
2017-02-25 01:06:17 +01:00
|
|
|
palette = "unifieddyes_palette_extended.png",
|
2015-01-03 07:52:39 +01:00
|
|
|
walkable = false,
|
|
|
|
light_source = light,
|
2017-02-05 01:41:36 +01:00
|
|
|
groups = {cracky=2,oddly_breakable_by_hand=1, ud_param2_colorable = 1,
|
2015-01-03 07:52:39 +01:00
|
|
|
not_in_creative_inventory=((light ~= nil) and 1) or nil,
|
2014-09-30 16:40:36 +02:00
|
|
|
},
|
2015-01-03 07:52:39 +01:00
|
|
|
selection_box = slamp_cbox,
|
2015-04-29 14:14:36 +02:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2015-05-14 12:25:11 +02:00
|
|
|
on_rotate = screwdriver.rotate_simple,
|
2017-02-05 01:41:36 +01:00
|
|
|
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
2017-01-29 06:58:31 +01:00
|
|
|
node.name = "homedecor:standing_lamp_"..repl[suffix]
|
2015-01-03 07:52:39 +01:00
|
|
|
minetest.set_node(pos, node)
|
|
|
|
end,
|
2017-03-14 07:13:17 +01:00
|
|
|
on_construct = unifieddyes.on_construct,
|
2018-08-22 11:08:48 +02:00
|
|
|
--expand = { top="air" },
|
|
|
|
drop = {
|
|
|
|
items = {
|
|
|
|
{items = {"homedecor:standing_lamp_off"}, inherit_color = true },
|
|
|
|
}
|
|
|
|
}
|
2014-09-30 16:40:36 +02:00
|
|
|
})
|
2015-01-03 07:52:39 +01:00
|
|
|
|
2015-04-14 21:34:17 +02:00
|
|
|
-- for old maps that had the original 3dforniture mod
|
2017-01-29 06:58:31 +01:00
|
|
|
minetest.register_alias("3dforniture:table_lamp_"..suffix, "homedecor:table_lamp_"..suffix)
|
2014-09-30 16:40:36 +02:00
|
|
|
end
|
|
|
|
|
2017-01-29 06:58:31 +01:00
|
|
|
reg_lamp("off", "low", nil, 1 )
|
|
|
|
reg_lamp("low", "med", 3, 2 )
|
|
|
|
reg_lamp("med", "hi", 7, 3 )
|
|
|
|
reg_lamp("hi", "max", 11, 4 )
|
|
|
|
reg_lamp("max", "off", 14, 5 )
|
2015-02-20 22:09:46 +01:00
|
|
|
|
2017-02-01 01:01:47 +01:00
|
|
|
-- "gooseneck" style desk lamps
|
|
|
|
|
2015-02-20 22:09:46 +01:00
|
|
|
local dlamp_cbox = {
|
2017-02-01 01:01:47 +01:00
|
|
|
type = "wallmounted",
|
|
|
|
wall_side = { -0.2, -0.5, -0.15, 0.32, 0.12, 0.15 },
|
2015-02-20 22:09:46 +01:00
|
|
|
}
|
|
|
|
|
2017-02-01 01:01:47 +01:00
|
|
|
homedecor.register("desk_lamp", {
|
|
|
|
description = S("Desk Lamp"),
|
|
|
|
mesh = "homedecor_desk_lamp.obj",
|
|
|
|
tiles = {
|
|
|
|
"homedecor_generic_metal.png",
|
|
|
|
"homedecor_generic_metal.png",
|
|
|
|
{ name = "homedecor_generic_metal.png", color = homedecor.color_med_grey },
|
|
|
|
{ name = "homedecor_table_standing_lamp_lightbulb.png", color = brightness_tab[5] },
|
|
|
|
},
|
|
|
|
inventory_image = "homedecor_desk_lamp_inv.png",
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "colorwallmounted",
|
|
|
|
palette = "unifieddyes_palette_colorwallmounted.png",
|
|
|
|
selection_box = dlamp_cbox,
|
|
|
|
node_box = dlamp_cbox,
|
|
|
|
walkable = false,
|
2017-02-05 01:41:36 +01:00
|
|
|
groups = {snappy=3, ud_param2_colorable = 1},
|
2017-03-18 10:51:46 +01:00
|
|
|
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
|
|
|
unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing)
|
|
|
|
end,
|
2017-02-18 19:01:49 +01:00
|
|
|
on_rotate = unifieddyes.fix_after_screwdriver_nsew
|
2017-02-01 01:01:47 +01:00
|
|
|
})
|
2015-02-20 22:09:46 +01:00
|
|
|
|
2017-02-01 01:01:47 +01:00
|
|
|
-- "kitchen"/"dining room" ceiling lamp
|
2015-04-22 03:33:06 +02:00
|
|
|
|
|
|
|
homedecor.register("ceiling_lamp", {
|
|
|
|
description = S("Ceiling Lamp"),
|
|
|
|
mesh = "homedecor_ceiling_lamp.obj",
|
|
|
|
tiles = {
|
2015-04-28 05:48:02 +02:00
|
|
|
"homedecor_generic_metal_brass.png",
|
2015-04-22 03:33:06 +02:00
|
|
|
"homedecor_ceiling_lamp_glass.png",
|
2017-01-25 10:22:28 +01:00
|
|
|
"homedecor_table_standing_lamp_lightbulb.png",
|
|
|
|
{ name = "homedecor_generic_plastic.png", color = 0xff442d04 },
|
2015-04-22 03:33:06 +02:00
|
|
|
},
|
2015-04-22 10:41:15 +02:00
|
|
|
inventory_image = "homedecor_ceiling_lamp_inv.png",
|
2015-08-01 15:08:48 +02:00
|
|
|
light_source = default.LIGHT_MAX,
|
2015-04-22 03:33:06 +02:00
|
|
|
groups = {snappy=3},
|
2015-04-29 14:14:36 +02:00
|
|
|
walkable = false,
|
2017-02-21 00:30:59 +01:00
|
|
|
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
2015-04-22 03:33:06 +02:00
|
|
|
minetest.set_node(pos, {name = "homedecor:ceiling_lamp_off"})
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
homedecor.register("ceiling_lamp_off", {
|
|
|
|
description = S("Ceiling Lamp (off)"),
|
|
|
|
mesh = "homedecor_ceiling_lamp.obj",
|
|
|
|
tiles = {
|
2015-04-28 05:48:02 +02:00
|
|
|
"homedecor_generic_metal_brass.png",
|
2015-04-22 03:33:06 +02:00
|
|
|
"homedecor_ceiling_lamp_glass.png",
|
2017-01-25 10:22:28 +01:00
|
|
|
{ "homedecor_table_standing_lamp_lightbulb.png", color = 0xffd0d0d0 },
|
|
|
|
{ name = "homedecor_generic_plastic.png", color = 0xff442d04 },
|
2015-04-22 03:33:06 +02:00
|
|
|
},
|
2015-04-22 10:37:18 +02:00
|
|
|
groups = {snappy=3, not_in_creative_inventory=1},
|
2015-04-29 14:14:36 +02:00
|
|
|
walkable = false,
|
2017-02-21 00:30:59 +01:00
|
|
|
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
2015-04-22 03:33:06 +02:00
|
|
|
minetest.set_node(pos, {name = "homedecor:ceiling_lamp"})
|
|
|
|
end,
|
|
|
|
drop = "homedecor:ceiling_lamp"
|
|
|
|
})
|
2017-01-29 06:58:31 +01:00
|
|
|
|
|
|
|
-- conversion LBM for param2 coloring
|
|
|
|
|
|
|
|
homedecor.old_static_nodes = {
|
|
|
|
"homedecor:glowlight_quarter_white",
|
|
|
|
"homedecor:glowlight_quarter_yellow",
|
|
|
|
"homedecor:glowlight_half_white",
|
|
|
|
"homedecor:glowlight_half_yellow",
|
|
|
|
"homedecor:glowlight_small_cube_white",
|
|
|
|
"homedecor:glowlight_small_cube_yellow"
|
|
|
|
}
|
|
|
|
|
|
|
|
local lamp_power = {"off", "low", "med", "hi", "max"}
|
|
|
|
|
|
|
|
for _, power in ipairs(lamp_power) do
|
|
|
|
for _, color in ipairs(lamp_colors) do
|
|
|
|
table.insert(homedecor.old_static_nodes, "homedecor:table_lamp_"..color.."_"..power)
|
|
|
|
table.insert(homedecor.old_static_nodes, "homedecor:standing_lamp_"..color.."_"..power)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
minetest.register_lbm({
|
|
|
|
name = "homedecor:convert_lighting",
|
|
|
|
label = "Convert homedecor glowlights, table lamps, and standing lamps to use param2 color",
|
2017-02-16 22:58:48 +01:00
|
|
|
run_at_every_load = false,
|
2017-01-29 06:58:31 +01:00
|
|
|
nodenames = homedecor.old_static_nodes,
|
|
|
|
action = function(pos, node)
|
|
|
|
local name = node.name
|
2017-01-29 09:31:02 +01:00
|
|
|
local newname
|
2017-01-29 06:58:31 +01:00
|
|
|
local color
|
|
|
|
|
|
|
|
if string.find(name, "small_cube") then
|
|
|
|
newname = "homedecor:glowlight_small_cube"
|
|
|
|
elseif string.find(name, "glowlight_half") then
|
|
|
|
newname = "homedecor:glowlight_half"
|
|
|
|
elseif string.find(name, "glowlight_quarter") then
|
|
|
|
newname = "homedecor:glowlight_quarter"
|
|
|
|
end
|
|
|
|
|
|
|
|
local lampname
|
2017-02-16 03:53:52 +01:00
|
|
|
if string.find(name, "standing_lamp") then
|
2017-01-29 06:58:31 +01:00
|
|
|
lampname = "homedecor:standing_lamp"
|
|
|
|
elseif string.find(name, "table_lamp") then
|
|
|
|
lampname = "homedecor:table_lamp"
|
|
|
|
end
|
|
|
|
if lampname then
|
|
|
|
newname = lampname
|
|
|
|
if string.find(name, "_off") then
|
|
|
|
newname = newname.."_off"
|
|
|
|
elseif string.find(name, "_low") then
|
|
|
|
newname = newname.."_low"
|
|
|
|
elseif string.find(name, "_med") then
|
|
|
|
newname = newname.."_med"
|
|
|
|
elseif string.find(name, "_hi") then
|
|
|
|
newname = newname.."_hi"
|
|
|
|
elseif string.find(name, "_max") then
|
|
|
|
newname = newname.."_max"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
if string.find(name, "red") then
|
|
|
|
color = "red"
|
|
|
|
elseif string.find(name, "pink") then
|
|
|
|
color = "pink"
|
|
|
|
elseif string.find(name, "green") then
|
|
|
|
color = "green"
|
|
|
|
elseif string.find(name, "blue") then
|
|
|
|
color = "blue"
|
|
|
|
elseif string.find(name, "yellow") then
|
|
|
|
color = "yellow"
|
|
|
|
elseif string.find(name, "violet") then
|
|
|
|
color = "violet"
|
|
|
|
else
|
|
|
|
color = "white"
|
|
|
|
end
|
|
|
|
|
2017-02-25 03:27:22 +01:00
|
|
|
local paletteidx, _ = unifieddyes.getpaletteidx("unifieddyes:"..color, "extended")
|
2017-01-29 09:31:02 +01:00
|
|
|
|
|
|
|
local old_fdir
|
|
|
|
local new_node = newname
|
2017-02-01 17:51:12 +01:00
|
|
|
local new_fdir = 1
|
2017-01-29 10:34:26 +01:00
|
|
|
local param2
|
2017-01-29 09:31:02 +01:00
|
|
|
|
2017-01-29 06:58:31 +01:00
|
|
|
if string.find(name, "glowlight") then
|
|
|
|
paletteidx, _ = unifieddyes.getpaletteidx("unifieddyes:"..color, "wallmounted")
|
2017-01-29 09:31:02 +01:00
|
|
|
|
|
|
|
old_fdir = math.floor(node.param2 / 4)
|
|
|
|
|
|
|
|
if old_fdir == 5 then
|
|
|
|
new_fdir = 0
|
|
|
|
elseif old_fdir == 1 then
|
|
|
|
new_fdir = 5
|
|
|
|
elseif old_fdir == 2 then
|
|
|
|
new_fdir = 4
|
|
|
|
elseif old_fdir == 3 then
|
|
|
|
new_fdir = 3
|
|
|
|
elseif old_fdir == 4 then
|
|
|
|
new_fdir = 2
|
|
|
|
elseif old_fdir == 0 then
|
|
|
|
new_fdir = 1
|
|
|
|
end
|
|
|
|
param2 = paletteidx + new_fdir
|
2017-01-29 06:58:31 +01:00
|
|
|
else
|
|
|
|
param2 = paletteidx
|
|
|
|
end
|
|
|
|
|
2017-02-27 23:02:20 +01:00
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
|
2017-02-25 07:02:51 +01:00
|
|
|
if string.find(name, "table_lamp") or string.find(name, "standing_lamp") then
|
|
|
|
meta:set_string("palette", "ext")
|
|
|
|
end
|
|
|
|
|
2017-01-29 09:31:02 +01:00
|
|
|
minetest.set_node(pos, { name = new_node, param2 = param2 })
|
2017-01-29 06:58:31 +01:00
|
|
|
meta:set_string("dye", "unifieddyes:"..color)
|
|
|
|
end
|
|
|
|
})
|
2017-02-01 01:01:47 +01:00
|
|
|
|
|
|
|
-- this one's for the small "gooseneck" desk lamps
|
|
|
|
|
|
|
|
homedecor.old_static_desk_lamps = {
|
|
|
|
"homedecor:desk_lamp_red",
|
|
|
|
"homedecor:desk_lamp_blue",
|
|
|
|
"homedecor:desk_lamp_green",
|
|
|
|
"homedecor:desk_lamp_violet",
|
|
|
|
}
|
|
|
|
|
|
|
|
minetest.register_lbm({
|
2017-02-01 14:50:03 +01:00
|
|
|
name = "homedecor:convert_desk_lamps",
|
|
|
|
label = "Convert homedecor desk lamps to use param2 color",
|
2017-02-16 22:58:48 +01:00
|
|
|
run_at_every_load = false,
|
2017-02-01 01:01:47 +01:00
|
|
|
nodenames = homedecor.old_static_desk_lamps,
|
|
|
|
action = function(pos, node)
|
|
|
|
local name = node.name
|
|
|
|
local color = string.sub(name, string.find(name, "_", -8) + 1)
|
|
|
|
|
|
|
|
if color == "green" then
|
|
|
|
color = "medium_green"
|
|
|
|
elseif color == "violet" then
|
|
|
|
color = "magenta"
|
|
|
|
end
|
|
|
|
|
|
|
|
local paletteidx, _ = unifieddyes.getpaletteidx("unifieddyes:"..color, "wallmounted")
|
|
|
|
local old_fdir = math.floor(node.param2 % 32)
|
|
|
|
local new_fdir = 3
|
|
|
|
|
|
|
|
if old_fdir == 0 then
|
|
|
|
new_fdir = 3
|
|
|
|
elseif old_fdir == 1 then
|
|
|
|
new_fdir = 4
|
|
|
|
elseif old_fdir == 2 then
|
|
|
|
new_fdir = 2
|
|
|
|
elseif old_fdir == 3 then
|
|
|
|
new_fdir = 5
|
|
|
|
end
|
|
|
|
|
|
|
|
local param2 = paletteidx + new_fdir
|
|
|
|
|
|
|
|
minetest.set_node(pos, { name = "homedecor:desk_lamp", param2 = param2 })
|
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
meta:set_string("dye", "unifieddyes:"..color)
|
|
|
|
end
|
|
|
|
})
|
2018-10-31 01:46:10 +01:00
|
|
|
|
|
|
|
local chains_sbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.1, -0.5, -0.1, 0.1, 0.5, 0.1 }
|
|
|
|
}
|
|
|
|
|
|
|
|
local topchains_sbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{ -0.25, 0.35, -0.25, 0.25, 0.5, 0.25 },
|
|
|
|
{ -0.1, -0.5, -0.1, 0.1, 0.4, 0.1 }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
minetest.register_node("homedecor:chain_steel_top", {
|
|
|
|
description = S("Hanging chain (ceiling mount, steel)"),
|
|
|
|
drawtype = "mesh",
|
|
|
|
mesh = "homedecor_chains_top.obj",
|
|
|
|
tiles = {"basic_materials_chain_steel.png"},
|
|
|
|
walkable = false,
|
|
|
|
climbable = true,
|
|
|
|
sunlight_propagates = true,
|
|
|
|
paramtype = "light",
|
|
|
|
inventory_image = "basic_materials_chain_steel_inv.png",
|
|
|
|
groups = {cracky=3},
|
|
|
|
selection_box = topchains_sbox,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("homedecor:chain_brass_top", {
|
|
|
|
description = S("Hanging chain (ceiling mount, brass)"),
|
|
|
|
drawtype = "mesh",
|
|
|
|
mesh = "homedecor_chains_top.obj",
|
|
|
|
tiles = {"basic_materials_chain_brass.png"},
|
|
|
|
walkable = false,
|
|
|
|
climbable = true,
|
|
|
|
sunlight_propagates = true,
|
|
|
|
paramtype = "light",
|
|
|
|
inventory_image = "basic_materials_chain_brass_inv.png",
|
|
|
|
groups = {cracky=3},
|
|
|
|
selection_box = topchains_sbox,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("homedecor:chandelier_steel", {
|
|
|
|
description = S("Chandelier (steel)"),
|
|
|
|
paramtype = "light",
|
|
|
|
light_source = 12,
|
|
|
|
walkable = false,
|
|
|
|
climbable = true,
|
|
|
|
sunlight_propagates = true,
|
|
|
|
tiles = {
|
|
|
|
"basic_materials_chain_steel.png",
|
|
|
|
"homedecor_candle_flat.png",
|
|
|
|
{
|
|
|
|
name="homedecor_candle_flame.png",
|
|
|
|
animation={
|
|
|
|
type="vertical_frames",
|
|
|
|
aspect_w=16,
|
|
|
|
aspect_h=16,
|
|
|
|
length=3.0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
drawtype = "mesh",
|
|
|
|
mesh = "homedecor_chandelier.obj",
|
|
|
|
groups = {cracky=3},
|
|
|
|
sounds = default.node_sound_stone_defaults(),
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("homedecor:chandelier_brass", {
|
|
|
|
description = S("Chandelier (brass)"),
|
|
|
|
paramtype = "light",
|
|
|
|
light_source = 12,
|
|
|
|
walkable = false,
|
|
|
|
climbable = true,
|
|
|
|
sunlight_propagates = true,
|
|
|
|
tiles = {
|
|
|
|
"basic_materials_chain_brass.png",
|
|
|
|
"homedecor_candle_flat.png",
|
|
|
|
{
|
|
|
|
name="homedecor_candle_flame.png",
|
|
|
|
animation={
|
|
|
|
type="vertical_frames",
|
|
|
|
aspect_w=16,
|
|
|
|
aspect_h=16,
|
|
|
|
length=3.0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
drawtype = "mesh",
|
|
|
|
mesh = "homedecor_chandelier.obj",
|
|
|
|
groups = {cracky=3},
|
|
|
|
sounds = default.node_sound_stone_defaults(),
|
|
|
|
})
|
|
|
|
|
|
|
|
-- crafts
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = 'homedecor:chain_steel_top',
|
|
|
|
recipe = {
|
|
|
|
{'default:steel_ingot'},
|
|
|
|
{'basic_materials:chainlink_steel'},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = 'homedecor:chandelier_steel',
|
|
|
|
recipe = {
|
|
|
|
{'', 'basic_materials:chainlink_steel', ''},
|
|
|
|
{'default:torch', 'basic_materials:chainlink_steel', 'default:torch'},
|
|
|
|
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
-- brass versions
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = 'homedecor:chain_brass_top',
|
|
|
|
recipe = {
|
|
|
|
{'basic_materials:brass_ingot'},
|
|
|
|
{'basic_materials:chainlink_brass'},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = 'homedecor:chandelier_brass',
|
|
|
|
recipe = {
|
|
|
|
{'', 'basic_materials:chainlink_brass', ''},
|
|
|
|
{'default:torch', 'basic_materials:chainlink_brass', 'default:torch'},
|
|
|
|
{'basic_materials:brass_ingot', 'basic_materials:brass_ingot', 'basic_materials:brass_ingot'},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_alias("chains:chain_top", "homedecor:chain_steel_top")
|
|
|
|
minetest.register_alias("chains:chain_top_brass", "homedecor:chain_brass_top")
|
|
|
|
|
|
|
|
minetest.register_alias("chains:chandelier_steel", "homedecor:chandelier_steel")
|
|
|
|
minetest.register_alias("chains:chandelier_brass", "homedecor:chandelier_brass")
|
|
|
|
|