move "medieval" wall lamp and torch to homedecor_lighting

make them mesecon/digiline controllable (on/off only, alldir rules)

also fix a couple of old texture references
This commit is contained in:
Vanessa Dannenberg 2019-06-02 02:35:20 -04:00
parent 2f3c12eb2a
commit ab8bf5586f
2 changed files with 69 additions and 53 deletions

View File

@ -58,61 +58,10 @@ homedecor.register("chains", {
sounds = default.node_sound_stone_defaults(),
})
homedecor.register("torch_wall", {
description = S("Wall Torch"),
mesh = "forniture_torch.obj",
tiles = {
{
name="forniture_torch_flame.png",
animation={
type="vertical_frames",
aspect_w=40,
aspect_h=40,
length=1.0,
},
},
{ name = "homedecor_generic_metal.png", color = homedecor.color_black },
{ name = "homedecor_generic_metal.png", color = homedecor.color_med_grey },
"forniture_coal.png",
},
inventory_image="forniture_torch_inv.png",
walkable = false,
light_source = 14,
selection_box = {
type = "fixed",
fixed = { -0.15, -0.45, 0.15, 0.15,0.35, 0.5 },
},
groups = {cracky=3},
})
local wl_cbox = {
type = "fixed",
fixed = { -0.2, -0.5, 0, 0.2, 0.5, 0.5 },
}
homedecor.register("wall_lamp", {
description = S("Wall Lamp"),
mesh = "homedecor_wall_lamp.obj",
tiles = {
{ name = "homedecor_generic_metal.png", color = homedecor.color_med_grey },
homedecor.lux_wood,
"homedecor_generic_light_source_yellow.png",
"homedecor_generic_metal_wrought_iron.png"
},
use_texture_alpha = true,
inventory_image = "homedecor_wall_lamp_inv.png",
groups = {snappy=3},
light_source = 11,
selection_box = wl_cbox,
walkable = false
})
minetest.register_alias("3dforniture:bars", "homedecor:bars")
minetest.register_alias("3dforniture:L_binding_bars", "homedecor:L_binding_bars")
minetest.register_alias("3dforniture:chains", "homedecor:chains")
minetest.register_alias("3dforniture:torch_wall", "homedecor:torch_wall")
minetest.register_alias('bars', 'homedecor:bars')
minetest.register_alias('binding_bars', 'homedecor:L_binding_bars')
minetest.register_alias('chains', 'homedecor:chains')
minetest.register_alias('torch_wall', 'homedecor:torch_wall')

View File

@ -623,8 +623,8 @@ for light_brightn_name in pairs(brightn_light_source) do
lighttex_tb = "homedecor_lattice_lantern_small_tb_light.png"
lighttex_sides = "homedecor_lattice_lantern_small_sides_light.png"
else
lighttex_tb = "homedecor_table_generic_light_source_off.png"
lighttex_sides = "homedecor_table_generic_light_source_off.png"
lighttex_tb = "homedecor_generic_light_source_off.png"
lighttex_sides = "homedecor_generic_light_source_off.png"
end
homedecor.register("lattice_lantern_small_"..light_brightn_name, {
@ -900,6 +900,9 @@ for _, light_brightn_name in ipairs({"off", "on"}) do
local onflag = (light_brightn_name == "on")
local gen_ls_tex_yellow = "homedecor_generic_light_source_off.png"
if onflag then gen_ls_tex_yellow = "homedecor_generic_light_source_yellow.png" end
local lighttex = "homedecor_blanktile.png"
if onflag then
lighttex = {
@ -937,6 +940,37 @@ for _, light_brightn_name in ipairs({"off", "on"}) do
digiline = homedecor.digiline_xz_light,
on_punch = digiline_on_punch
})
local wl_cbox = {
type = "fixed",
fixed = { -0.2, -0.5, 0, 0.2, 0.5, 0.5 },
}
homedecor.register("wall_lamp_"..light_brightn_name, {
description = S("Wall Lamp"),
mesh = "homedecor_wall_lamp.obj",
tiles = {
{ name = "homedecor_generic_metal.png", color = homedecor.color_med_grey },
homedecor.lux_wood,
gen_ls_tex_yellow,
"homedecor_generic_metal_wrought_iron.png"
},
use_texture_alpha = true,
inventory_image = "homedecor_wall_lamp_inv.png",
groups = {snappy=3, not_in_creative_inventory = nici},
light_source = onflag and (default.LIGHT_MAX - 3) or nil,
selection_box = wl_cbox,
walkable = false,
drop = {
items = {
{items = {"homedecor:wall_lamp_on"}},
}
},
on_rightclick = homedecor.toggle_light,
mesecons = homedecor.mesecon_alldir_light,
digiline = homedecor.digiline_alldir_light,
on_punch = digiline_on_punch
})
end
-------------------------------------------------------
@ -1172,6 +1206,33 @@ minetest.register_node(":homedecor:chandelier_brass", {
sounds = default.node_sound_stone_defaults(),
})
homedecor.register("torch_wall", {
description = S("Wall Torch"),
mesh = "forniture_torch.obj",
tiles = {
{
name="forniture_torch_flame.png",
animation={
type="vertical_frames",
aspect_w=40,
aspect_h=40,
length=1.0,
},
},
{ name = "homedecor_generic_metal.png", color = homedecor.color_black },
{ name = "homedecor_generic_metal.png", color = homedecor.color_med_grey },
"forniture_coal.png",
},
inventory_image="forniture_torch_inv.png",
walkable = false,
light_source = 14,
selection_box = {
type = "fixed",
fixed = { -0.15, -0.45, 0.15, 0.15,0.35, 0.5 },
},
groups = {cracky=3},
})
-- table lamps and standing lamps
local lamp_colors = {
@ -1828,9 +1889,15 @@ minetest.register_alias("homedecor:table_lamp_max", "homedecor:table_
minetest.register_alias("homedecor:standing_lamp", "homedecor:standing_lamp_on")
minetest.register_alias("homedecor:standing_lamp_max", "homedecor:standing_lamp_on")
minetest.register_alias("homedecor:wall_lamp", "homedecor:wall_lamp_on")
minetest.register_alias("homedecor:wall_lamp_max", "homedecor:wall_lamp_on")
-- for old maps that had the original 3dforniture mod
minetest.register_alias("3dforniture:table_lamp", "homedecor:table_lamp_on")
minetest.register_alias("3dforniture:torch_wall", "homedecor:torch_wall")
minetest.register_alias("torch_wall", "homedecor:torch_wall")
if minetest.get_modpath("darkage") then
minetest.register_alias("homedecor:lattice_lantern_large_off", "darkage:lamp")
minetest.register_alias("homedecor:lattice_lantern_large_low", "darkage:lamp")