|
|
|
@ -11,6 +11,8 @@ local function is_protected(pos, clicker)
|
|
|
|
|
return false
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local hd_mesecons = minetest.get_modpath("mesecons")
|
|
|
|
|
|
|
|
|
|
-- control and brightness for dimmable lamps
|
|
|
|
|
|
|
|
|
|
local brightn_cycle = {
|
|
|
|
@ -51,7 +53,7 @@ local rules_alldir = {
|
|
|
|
|
|
|
|
|
|
local actions
|
|
|
|
|
|
|
|
|
|
if minetest.get_modpath("mesecons") then
|
|
|
|
|
if hd_mesecons then
|
|
|
|
|
|
|
|
|
|
actions = {
|
|
|
|
|
action_off = function(pos, node)
|
|
|
|
@ -132,7 +134,7 @@ if minetest.get_modpath("digilines") then
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
if minetest.get_modpath("mesecons") then
|
|
|
|
|
if hd_mesecons then
|
|
|
|
|
homedecor.digiline_wall_light = {
|
|
|
|
|
effector = {
|
|
|
|
|
action = on_digiline_receive_string,
|
|
|
|
@ -182,10 +184,14 @@ function homedecor.toggle_light(pos, node, clicker, itemstack, pointed_thing)
|
|
|
|
|
local level = string.sub(node.name, sep + 1)
|
|
|
|
|
local n = tonumber(level) or 0
|
|
|
|
|
|
|
|
|
|
if level == "off" or n < 4 then
|
|
|
|
|
newsuff = "_14"
|
|
|
|
|
else
|
|
|
|
|
if level == "on" then
|
|
|
|
|
newsuff = "_off"
|
|
|
|
|
elseif level == "off" then
|
|
|
|
|
newsuff = "_on"
|
|
|
|
|
elseif n > 3 then
|
|
|
|
|
newsuff = "_0"
|
|
|
|
|
else
|
|
|
|
|
newsuff = "_14"
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
minetest.swap_node(pos, {name = string.sub(node.name, 1, sep - 1)..newsuff, param2 = node.param2})
|
|
|
|
@ -724,7 +730,7 @@ for brightness_level = 0, 14 do
|
|
|
|
|
paramtype2 = "color",
|
|
|
|
|
palette = "unifieddyes_palette_extended.png",
|
|
|
|
|
walkable = false,
|
|
|
|
|
light_source = word_to_bright[light_brightn_name],
|
|
|
|
|
light_source = brightness_level,
|
|
|
|
|
groups = {cracky=2,oddly_breakable_by_hand=1, ud_param2_colorable = 1, not_in_creative_inventory=nici },
|
|
|
|
|
selection_box = slamp_cbox,
|
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
|
|
|
@ -749,6 +755,15 @@ for _, light_brightn_name in ipairs({"off", "on"}) do
|
|
|
|
|
|
|
|
|
|
local onflag = (light_brightn_name == "on")
|
|
|
|
|
local nici = (light_brightn_name == "off") and 1 or nil
|
|
|
|
|
local nici_m = (light_brightn_name == "off") and 1 or nil
|
|
|
|
|
local on_rc = homedecor.toggle_light
|
|
|
|
|
local di = "on"
|
|
|
|
|
|
|
|
|
|
if hd_mesecons then
|
|
|
|
|
nici_m = (light_brightn_name ~= "off") and 1 or nil
|
|
|
|
|
on_rc = nil
|
|
|
|
|
di = "off"
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local gen_ls_tex_white = "homedecor_generic_light_source_off.png"
|
|
|
|
|
if onflag then gen_ls_tex_white = "homedecor_generic_light_source_white.png" end
|
|
|
|
@ -765,7 +780,7 @@ for _, light_brightn_name in ipairs({"off", "on"}) do
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
homedecor.register("plasma_ball_"..light_brightn_name, {
|
|
|
|
|
description = S("Plasma Ball"),
|
|
|
|
|
description = S("Plasma Ball/light"),
|
|
|
|
|
mesh = "homedecor_plasma_ball.obj",
|
|
|
|
|
tiles = {
|
|
|
|
|
{ name = "homedecor_generic_plastic.png", color = homedecor.color_black },
|
|
|
|
@ -829,14 +844,14 @@ for _, light_brightn_name in ipairs({"off", "on"}) do
|
|
|
|
|
"homedecor:rope_light_on_floor_off",
|
|
|
|
|
"group:mesecon_conductor_craftable"
|
|
|
|
|
},
|
|
|
|
|
groups = {cracky=3, not_in_creative_inventory = nici},
|
|
|
|
|
groups = {cracky=3, oddly_breakable_by_hand=3, not_in_creative_inventory = nici_m},
|
|
|
|
|
sounds = default.node_sound_stone_defaults(),
|
|
|
|
|
on_rightclick = homedecor.toggle_light,
|
|
|
|
|
drop = {
|
|
|
|
|
items = {
|
|
|
|
|
{items = {"homedecor:rope_light_on_floor_on"} },
|
|
|
|
|
{items = {"homedecor:rope_light_on_floor_"..di} },
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
on_rightclick = on_rc,
|
|
|
|
|
mesecons = {
|
|
|
|
|
conductor = {
|
|
|
|
|
state = mesecon and (onflag and mesecon.state.on or mesecon.state.off),
|
|
|
|
@ -875,14 +890,14 @@ for _, light_brightn_name in ipairs({"off", "on"}) do
|
|
|
|
|
"homedecor:rope_light_on_ceiling_off",
|
|
|
|
|
"group:mesecon_conductor_craftable"
|
|
|
|
|
},
|
|
|
|
|
groups = {cracky=3, not_in_creative_inventory = nici},
|
|
|
|
|
groups = {cracky=3, oddly_breakable_by_hand=3, not_in_creative_inventory = nici_m},
|
|
|
|
|
sounds = default.node_sound_stone_defaults(),
|
|
|
|
|
on_rightclick = homedecor.toggle_light,
|
|
|
|
|
drop = {
|
|
|
|
|
items = {
|
|
|
|
|
{items = {"homedecor:rope_light_on_ceiling_on"}},
|
|
|
|
|
{items = {"homedecor:rope_light_on_ceiling_"..di}},
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
on_rightclick = on_rc,
|
|
|
|
|
mesecons = {
|
|
|
|
|
conductor = {
|
|
|
|
|
state = mesecon and (onflag and mesecon.state.on or mesecon.state.off),
|
|
|
|
@ -894,7 +909,7 @@ for _, light_brightn_name in ipairs({"off", "on"}) do
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
homedecor.register("wall_lamp_"..light_brightn_name, {
|
|
|
|
|
description = S("Wall Lamp"),
|
|
|
|
|
description = S("Wall Lamp/light"),
|
|
|
|
|
mesh = "homedecor_wall_lamp.obj",
|
|
|
|
|
tiles = {
|
|
|
|
|
{ name = "homedecor_generic_metal.png", color = homedecor.color_med_grey },
|
|
|
|
@ -1785,6 +1800,7 @@ unifieddyes.register_color_craft({
|
|
|
|
|
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", "homedecor:chandelier_steel")
|
|
|
|
|
minetest.register_alias("chains:chandelier_steel", "homedecor:chandelier_steel")
|
|
|
|
|
minetest.register_alias("chains:chandelier_brass", "homedecor:chandelier_brass")
|
|
|
|
|
|
|
|
|
@ -1797,18 +1813,9 @@ minetest.register_alias("homedecor:glowlight_quarter_max", "homedecor:glowli
|
|
|
|
|
minetest.register_alias("homedecor:glowlight_small_cube", "homedecor:glowlight_small_cube_14")
|
|
|
|
|
minetest.register_alias("homedecor:glowlight_small_cube_max", "homedecor:glowlight_small_cube_14")
|
|
|
|
|
|
|
|
|
|
minetest.register_alias("homedecor:rope_light_14_floor", "homedecor:rope_light_on_floor_14")
|
|
|
|
|
minetest.register_alias("homedecor:rope_light_on_floor_max", "homedecor:rope_light_on_floor_14")
|
|
|
|
|
|
|
|
|
|
minetest.register_alias("homedecor:rope_light_on_ceiling", "homedecor:rope_light_on_ceiling_14")
|
|
|
|
|
minetest.register_alias("homedecor:rope_light_on_ceiling_max", "homedecor:rope_light_on_ceiling_14")
|
|
|
|
|
|
|
|
|
|
minetest.register_alias("homedecor:plasma_lamp", "homedecor:plasma_lamp_14")
|
|
|
|
|
minetest.register_alias("homedecor:plasma_lamp_max", "homedecor:plasma_lamp_14")
|
|
|
|
|
|
|
|
|
|
minetest.register_alias("homedecor:plasma_ball", "homedecor:plasma_ball_14")
|
|
|
|
|
minetest.register_alias("homedecor:plasma_ball_max", "homedecor:plasma_ball_14")
|
|
|
|
|
|
|
|
|
|
minetest.register_alias("homedecor:ground_lantern", "homedecor:ground_lantern_14")
|
|
|
|
|
minetest.register_alias("homedecor:ground_lantern_max", "homedecor:ground_lantern_14")
|
|
|
|
|
|
|
|
|
@ -1836,14 +1843,21 @@ minetest.register_alias("homedecor:table_lamp_max", "homedecor:table_
|
|
|
|
|
minetest.register_alias("homedecor:standing_lamp", "homedecor:standing_lamp_14")
|
|
|
|
|
minetest.register_alias("homedecor:standing_lamp_max", "homedecor:standing_lamp_14")
|
|
|
|
|
|
|
|
|
|
minetest.register_alias("homedecor:wall_lamp", "homedecor:wall_lamp_on")
|
|
|
|
|
|
|
|
|
|
minetest.register_alias("3dforniture:table_lamp", "homedecor:table_lamp_14")
|
|
|
|
|
minetest.register_alias("3dforniture:table_lamp_max", "homedecor:table_lamp_14")
|
|
|
|
|
|
|
|
|
|
minetest.register_alias("3dforniture:torch_wall", "homedecor:torch_wall")
|
|
|
|
|
minetest.register_alias("torch_wall", "homedecor:torch_wall")
|
|
|
|
|
|
|
|
|
|
minetest.register_alias("homedecor:plasma_ball", "homedecor:plasma_ball_on")
|
|
|
|
|
minetest.register_alias("homedecor:wall_lamp", "homedecor:wall_lamp_on")
|
|
|
|
|
|
|
|
|
|
minetest.register_alias("homedecor:rope_light_on_floor_0", "homedecor:rope_light_on_floor_off")
|
|
|
|
|
minetest.register_alias("homedecor:rope_light_on_floor_14", "homedecor:rope_light_on_floor_on")
|
|
|
|
|
|
|
|
|
|
minetest.register_alias("homedecor:rope_light_on_ceiling_0", "homedecor:rope_light_on_ceiling_off")
|
|
|
|
|
minetest.register_alias("homedecor:rope_light_on_ceiling_14", "homedecor:rope_light_on_ceiling_on")
|
|
|
|
|
|
|
|
|
|
for name, level in pairs(word_to_bright) do
|
|
|
|
|
minetest.register_alias("homedecor:glowlight_half_"..name, "homedecor:glowlight_half_"..level)
|
|
|
|
|
minetest.register_alias("homedecor:glowlight_quarter_"..name, "homedecor:glowlight_quarter_"..level)
|
|
|
|
|