diff --git a/homedecor_bathroom/depends.txt b/homedecor_bathroom/depends.txt index 8cb6cfda..e778f7de 100644 --- a/homedecor_bathroom/depends.txt +++ b/homedecor_bathroom/depends.txt @@ -3,3 +3,5 @@ default basic_materials unifieddyes building_blocks +bucket? +homedecor_fences? diff --git a/homedecor_bathroom/init.lua b/homedecor_bathroom/init.lua index 0811b700..a043d899 100644 --- a/homedecor_bathroom/init.lua +++ b/homedecor_bathroom/init.lua @@ -347,7 +347,10 @@ homedecor.register("shower_head", { on_rotate = screwdriver.disallow, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) local below = minetest.get_node_or_nil({x=pos.x, y=pos.y-2.0, z=pos.z}) - if below and below.name == "homedecor:shower_tray" then + if below and ( + below.name == "homedecor:shower_tray" or + below.name == "homedecor:bathtub_clawfoot_brass_taps" or + below.name == "homedecor:bathtub_clawfoot_chrome_taps" ) then local particledef = { outlet = { x = 0, y = -0.42, z = 0.1 }, velocity_x = { min = -0.15, max = 0.15 }, @@ -364,6 +367,27 @@ homedecor.register("shower_head", { end }) +local tub_sbox = { + type = "fixed", + fixed = { -0.5, -0.5, -0.5, 1.5, 0.3125, 0.5 }, +} + +local tub_cbox = { + type = "fixed", + fixed = { + {-0.4375, -0.0625, -0.5, 1.4375, 0.5, -0.4375}, -- NodeBox1 + {-0.4375, -0.0625, 0.4375, 1.4375, 0.5, 0.5}, -- NodeBox2 + {-0.5, 0.1875, -0.4375, -0.4375, 0.5, 0.4375}, -- NodeBox3 + {1.4375, -0.0625, -0.4375, 1.5, 0.5, 0.4375}, -- NodeBox4 + {-0.3125, -0.3125, -0.4375, -0.125, -0.0625, 0.4375}, -- NodeBox5 + {1.375, -0.3125, -0.4375, 1.4375, -0.0625, 0.4375}, -- NodeBox6 + {-0.125, -0.3125, 0.375, 1.375, -0.0625, 0.4375}, -- NodeBox7 + {-0.125, -0.3125, -0.4375, 1.375, -0.0625, -0.375}, -- NodeBox8 + {-0.125, -0.5, -0.375, 1.375, -0.3125, 0.375}, -- NodeBox9 + {-0.4375, -0.0625, -0.4375, -0.3125, 0.1875, 0.4375}, -- NodeBox10 + } +} + homedecor.register("bathtub_clawfoot_brass_taps", { drawtype = "mesh", mesh = "homedecor_bathtub_clawfoot.obj", @@ -377,10 +401,8 @@ homedecor.register("bathtub_clawfoot_brass_taps", { }, description = S("Bathtub, clawfoot, with brass taps"), groups = {cracky=3}, - selection_box = { - type = "fixed", - fixed = { -0.5, -0.5, -0.5, 1.5, 0.3125, 0.5 }, - }, + selection_box = tub_sbox, + node_box = tub_cbox, sounds = default.node_sound_stone_defaults(), }) @@ -397,10 +419,8 @@ homedecor.register("bathtub_clawfoot_chrome_taps", { }, description = S("Bathtub, clawfoot, with chrome taps"), groups = {cracky=3}, - selection_box = { - type = "fixed", - fixed = { -0.5, -0.5, -0.5, 1.5, 0.3125, 0.5 }, - }, + selection_box = tub_sbox, + node_box = tub_cbox, sounds = default.node_sound_stone_defaults(), }) @@ -531,8 +551,8 @@ minetest.register_craft({ minetest.register_craft( { output = "homedecor:bathroom_tiles_light 4", recipe = { - { "group:marble", "group:marble", "" }, - { "group:marble", "group:marble", "dye:white" } + { "group:marble", "group:marble" }, + { "group:marble", "group:marble" } }, }) @@ -593,3 +613,67 @@ minetest.register_craft({ { "group:stick", "basic_materials:plastic_sheet", "group:stick" } }, }) + +minetest.register_craft({ + output = "homedecor:toilet", + recipe = { + { "","","bucket:bucket_water"}, + { "group:marble","group:marble", "group:marble" }, + { "", "bucket:bucket_empty", "" }, + }, +}) + +minetest.register_craft({ + output = "homedecor:sink", + recipe = { + { "group:marble","bucket:bucket_empty", "group:marble" }, + { "", "group:marble", "" } + }, +}) + +minetest.register_craft({ + output = "homedecor:taps", + recipe = { + { "default:steel_ingot","bucket:bucket_water", "default:steel_ingot" }, + }, +}) + +minetest.register_craft({ + output = "homedecor:taps_brass", + recipe = { + { "basic_materials:brass_ingot","bucket:bucket_water", "basic_materials:brass_ingot" }, + }, +}) + +minetest.register_craft({ + output = "homedecor:shower_tray", + recipe = { + { "group:marble","bucket:bucket_empty", "group:marble" }, + }, +}) + +minetest.register_craft({ + output = "homedecor:shower_head", + recipe = { + {"default:steel_ingot", "bucket:bucket_water"}, + }, +}) + +minetest.register_craft({ + output = "homedecor:bathtub_clawfoot_brass_taps", + recipe = { + { "homedecor:taps_brass", "", "" }, + { "group:marble", "", "group:marble" }, + { "default:steel_ingot", "group:marble", "default:steel_ingot"}, + }, +}) + +minetest.register_craft({ + output = "homedecor:bathtub_clawfoot_chrome_taps", + recipe = { + { "homedecor:taps", "", "" }, + { "group:marble", "", "group:marble" }, + {"default:steel_ingot", "group:marble", "default:steel_ingot"}, + }, +}) + diff --git a/homedecor_climate_control/init.lua b/homedecor_climate_control/init.lua index 5524f261..bddf8584 100644 --- a/homedecor_climate_control/init.lua +++ b/homedecor_climate_control/init.lua @@ -143,7 +143,19 @@ homedecor.register("radiator", { }) -- crafting +minetest.register_craftitem(":homedecor:fan_blades", { + description = S("Fan blades"), + inventory_image = "homedecor_fan_blades.png" +}) +minetest.register_craft( { + output = "homedecor:fan_blades 2", + recipe = { + { "", "basic_materials:plastic_sheet", "" }, + { "", "default:steel_ingot", "" }, + { "basic_materials:plastic_sheet", "", "basic_materials:plastic_sheet" } + }, +}) minetest.register_craft({ output = "homedecor:air_conditioner", diff --git a/homedecor_climate_control/textures/homedecor_fan_blades.png b/homedecor_climate_control/textures/homedecor_fan_blades.png new file mode 100644 index 00000000..efb9f7c7 Binary files /dev/null and b/homedecor_climate_control/textures/homedecor_fan_blades.png differ diff --git a/homedecor_doors_and_gates/depends.txt b/homedecor_doors_and_gates/depends.txt index b93a08fe..c897dba1 100644 --- a/homedecor_doors_and_gates/depends.txt +++ b/homedecor_doors_and_gates/depends.txt @@ -1,4 +1,5 @@ homedecor_common +homedecor_misc? default basic_materials dye diff --git a/homedecor_doors_and_gates/init.lua b/homedecor_doors_and_gates/init.lua index 1435cbe3..effc6951 100644 --- a/homedecor_doors_and_gates/init.lua +++ b/homedecor_doors_and_gates/init.lua @@ -2,293 +2,139 @@ local S = homedecor.gettext -local function N_(x) return x end +-- new doors using minetest_game doors API -local m_rules -if minetest.global_exists("mesecon") then - m_rules = mesecon and mesecon.rules and mesecon.rules.pplate -end - --- doors - -local function isSolid(pos, adjust) - local adj = {x = adjust[1], y = adjust[2], z = adjust[3]} - local node = minetest.get_node(vector.add(pos,adj)) - if node then - local idef = minetest.registered_nodes[minetest.get_node(vector.add(pos,adj)).name] - if idef then - return idef.walkable - end - end - return false -end - -local function countSolids(pos,node,level) - local solids = 0 - for x = -1, 1 do - for z = -1, 1 do - local y = (node.param2 == 5) and -level or level - -- special cases when x == z == 0 - if x == 0 and z == 0 then - if level == 1 then - -- when looking past the trap door, cannot be solid in center - if isSolid(pos,{x,y,z}) then - return false - end - -- no else. it doesn't matter if x == y == z is solid, that's us. - end - elseif isSolid(pos,{x,y,z}) then - solids = solids + 1 - end - end - end - return solids -end - -local function calculateClosed(pos) - local node = minetest.get_node(pos) - -- the door is considered closed if it is closing off something. - - local direction = node.param2 % 6 - local isTrap = direction == 0 or direction == 5 - if isTrap then - -- the trap door is considered closed when all nodes on its sides are solid - -- or all nodes in the 3x3 above/below it are solid except the center - for level = 0, 1 do - local solids = countSolids(pos,node,level) - if solids == 8 then - return true - end - end - return false - else - -- the door is considered closed when the nodes on its sides are solid - -- or the 3 nodes in its facing direction are solid nonsolid solid - -- if the door has two levels (i.e. not a gate) then this must - -- be true for the top node as well. - - -- sorry I dunno the math to figure whether to x or z - if direction == 1 or direction == 2 then - if isSolid(pos,{0,0,-1}) and isSolid(pos,{0,0,1}) then - if string.find(node.name,'_bottom_') then - return calculateClosed({x=pos.x,y=pos.y+1,z=pos.z}) - else - return true - end - end - local x = (direction == 1) and 1 or -1 - if isSolid(pos,{x,0,-1}) and not isSolid(pos,{x,0,0}) and isSolid(pos,{x,0,1}) then - if string.find(node.name,'_bottom_') then - return calculateClosed({x=pos.x,y=pos.y+1,z=pos.z}) - else - return true - end - end - return false - else - -- direction == 3 or 4 - if isSolid(pos,{-1,0,0}) and isSolid(pos,{1,0,0}) then - if string.find(node.name,'_bottom_') then - return calculateClosed({x=pos.x,y=pos.y+1,z=pos.z}) - else - return true - end - end - local z = (direction == 3) and 1 or -1 - if isSolid(pos,{-1,0,z}) and not isSolid(pos,{0,0,z}) and isSolid(pos,{1,0,z}) then - if string.find(node.name,'_bottom_') then - return calculateClosed({x=pos.x,y=pos.y+1,z=pos.z}) - else - return true - end - end - return false - end - end -end - --- isClosed flag, is 0 or 1 0 = open, 1 = closed -local function getClosed(pos) - local isClosed = minetest.get_meta(pos):get_string('closed') - if isClosed=='' then - return calculateClosed(pos) - else - isClosed = tonumber(isClosed) - -- may be closed or open (1 or 0) - return isClosed == 1 - end -end - -local function addDoorNode(pos,def,isClosed) - minetest.set_node(pos, def) - minetest.get_meta(pos):set_int('closed', isClosed and 1 or 0) -end - -local door_model_list = { - { name = "closet_mahogany", - description = N_("Mahogany Closet Door (@1 opening)"), - mesh = "homedecor_door_closet.obj" - }, - - { name = "closet_oak", - description = N_("Oak Closet Door (@1 opening)"), - mesh = "homedecor_door_closet.obj" +local door_list = { + { name = "wood_plain", + description = "Plain Wooden Door", + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + sounds = { + main = default.node_sound_wood_defaults(), + open = "homedecor_door_open", + close = "homedecor_door_close", + } }, { name = "exterior_fancy", - description = N_("Fancy Wood/Glass Door (@1 opening)"), - mesh = "homedecor_door_fancy.obj", - tiles = { - "homedecor_door_exterior_fancy.png", - "homedecor_door_exterior_fancy_insert.png" + description = "Fancy Wood/Glass Door", + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + sounds = { + main = default.node_sound_wood_defaults(), + open = "homedecor_door_open", + close = "homedecor_door_close", }, - usealpha = true + backface = true, + alpha = true }, { name = "wood_glass_oak", - description = N_("Glass and Wood, Oak-colored (@1 opening)"), - mesh = "homedecor_door_wood_glass.obj", - tiles = { - "homedecor_door_wood_glass_oak.png", - "homedecor_door_wood_glass_insert.png", - } + description = "Glass and Wood, Oak-colored", + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + sounds = { + main = default.node_sound_glass_defaults(), + }, }, { name = "wood_glass_mahogany", - description = N_("Glass and Wood, Mahogany-colored (@1 opening)"), - mesh = "homedecor_door_wood_glass.obj", - tiles = { - "homedecor_door_wood_glass_mahogany.png", - "homedecor_door_wood_glass_insert.png", - } + description = "Glass and Wood, Mahogany-colored", + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + sounds = { + main = default.node_sound_glass_defaults(), + }, }, { name = "wood_glass_white", - description = N_("Glass and Wood, White (@1 opening)"), - mesh = "homedecor_door_wood_glass.obj", - tiles = { - "homedecor_door_wood_glass_white.png", - "homedecor_door_wood_glass_insert.png", - } - }, - - { name = "wood_plain", - description = N_("Plain Wooden Door (@1 opening)"), - mesh = "homedecor_door_plain.obj" + description = "Glass and Wood, White", + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + sounds = { + main = default.node_sound_glass_defaults(), + }, }, { name = "bedroom", - description = N_("White Bedroom Door (@1 opening)"), - mesh = "homedecor_door_plain.obj" + description = "White Bedroom Door", + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + sounds = { + main = default.node_sound_wood_defaults(), + open = "homedecor_door_open", + close = "homedecor_door_close", + } }, { name = "wrought_iron", - description = N_("Wrought Iron Gate/Door (@1 opening)"), - mesh = "homedecor_door_wrought_iron.obj" + description = "Wrought Iron Gate/Door", + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + sounds = { + main = default.node_sound_metal_defaults(), + open = "doors_steel_door_open", + close = "doors_steel_door_close", + }, + backface = true, }, { name = "woodglass", - description = N_("Wooden door with glass insert (@1 opening)"), - mesh = "homedecor_door_woodglass_typea.obj", - tiles = { - "homedecor_door_woodglass_typea.png", - "homedecor_door_woodglass_typea_insert.png", + description = "Wooden door with glass insert", + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + sounds = { + main = default.node_sound_wood_defaults(), + open = "homedecor_door_open", + close = "homedecor_door_close", }, - usealpha = true + backface = true, + alpha = true }, { name = "woodglass2", - description = N_("Wooden door with glass insert, type 2 (@1 opening)"), - mesh = "homedecor_door_plain.obj", - usealpha = true + description = "Wooden door with glass insert, type 2", + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + sounds = { + main = default.node_sound_wood_defaults(), + open = "homedecor_door_open", + close = "homedecor_door_close", + }, + backface = true, + alpha = true + }, + + { name = "closet_mahogany", + description = "Mahogany Closet Door", + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + sounds = { + main = default.node_sound_wood_defaults(), + } + }, + + { name = "closet_oak", + description = "Oak Closet Door", + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + sounds = { + main = default.node_sound_wood_defaults(), + } }, } -local def_selbox = { - type = "fixed", - fixed = { -0.5, -0.5, 0.375, 0.5, 1.5, 0.5 } -} +local old_doors = {} -local sides = { N_("left"), N_("right") } - -for i, side in ipairs(sides) do - - for _, door_model in ipairs(door_model_list) do - - local doorname = door_model.name - - local selbox = door_model.selectbox or def_selbox - local colbox = door_model.collisionbox or door_model.selectbox or def_selbox - local mesh = door_model.mesh - local groups = {snappy = 3} - - if side == "right" then - mesh = string.gsub(door_model.mesh, ".obj", "_right.obj") - groups = {snappy = 3, not_in_creative_inventory = 1} - end - - minetest.register_node(":homedecor:door_"..doorname.."_"..side, { - description = S(door_model.description, S(side)), - drawtype = "mesh", - mesh = mesh, - tiles = door_model.tiles or { "homedecor_door_"..doorname..".png" }, - inventory_image = "homedecor_door_"..doorname.."_inv.png", - wield_image = "homedecor_door_"..doorname.."_inv.png", - paramtype = "light", - paramtype2 = "facedir", - groups = groups, - sounds = default.node_sound_wood_defaults(), - use_texture_alpha = door_model.usealpha, - selection_box = selbox, - collision_box = colbox, - on_rotate = screwdriver.rotate_simple, - on_place = function(itemstack, placer, pointed_thing) - return homedecor.stack_wing(itemstack, placer, pointed_thing, - "homedecor:door_"..doorname.."_left", "air", - "homedecor:door_"..doorname.."_right", "air") - end, - on_construct = function(pos) - minetest.get_meta(pos):set_int("closed", 1) - end, - on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - homedecor.flip_door(pos, node, clicker, doorname, side) - return itemstack - end, - -- both left and right doors may be used for open or closed doors - -- so they have to have both action_on and action_off and just - -- check when that action is invoked if to continue - - on_punch = function(pos, node, puncher) - minetest.get_meta(pos):set_string('closed',nil) - end, - drop = "homedecor:door_"..doorname.."_left", - mesecons = { - effector = { - rules = m_rules, - action_on = function(pos,node) - local isClosed = getClosed(pos) - if isClosed then - homedecor.flip_door(pos,node,nil,doorname,side,isClosed) - end - end, - action_off = function(pos,node) - local isClosed = getClosed(pos) - if not isClosed then - homedecor.flip_door(pos,node,nil,doorname,side,isClosed) - end - end - } - } +for _, door in ipairs(door_list) do + doors.register(door.name, { + tiles = {{ name = "homedecor_door_"..door.name..".png", backface_culling = door.backface }}, + description = door.description, + inventory_image = "homedecor_door_"..door.name.."_inv.png", + groups = table.copy(door.groups), + sounds = door.sounds.main, + sound_open = door.sounds.open, + sound_close = door.sounds.close + }) + if door.alpha then + minetest.override_item("doors:"..door.name.."_a", { + use_texture_apha = true }) - - minetest.register_alias("homedecor:door_"..doorname.."_top_"..side, "air") - minetest.register_alias("homedecor:door_"..doorname.."_bottom_"..side, "homedecor:door_"..doorname.."_"..side) - - end - - minetest.register_alias("homedecor:door_wood_glass_top_"..side, "air") - minetest.register_alias("homedecor:door_wood_glass_bottom_"..side, "homedecor:door_wood_glass_oak_"..side) - + minetest.override_item("doors:"..door.name.."_b", { + use_texture_apha = true + }) + end + old_doors[#old_doors + 1] = "homedecor:door_"..door.name.."_left" + old_doors[#old_doors + 1] = "homedecor:door_"..door.name.."_right" end -- Gates @@ -451,56 +297,11 @@ minetest.register_alias("homedecor:fence_picket_gate_closed", "homedecor:g minetest.register_alias("homedecor:fence_picket_gate_white_open", "homedecor:gate_picket_white_open") minetest.register_alias("homedecor:fence_picket_gate_white_closed", "homedecor:gate_picket_white_closed") --- to open a door, you switch left for right and subtract from param2, or vice versa right for left --- that is to say open "right" doors become left door nodes, and open left doors right door nodes. --- also adjusting param2 so the node is at 90 degrees. - -function homedecor.flip_door(pos, node, player, name, side, isClosed) - if isClosed == nil then - isClosed = getClosed(pos) - end - -- this is where we swap the isClosed status! - -- i.e. if isClosed, we're adding an open door - -- and if not isClosed, a closed door - isClosed = not isClosed - - local rside - local nfdir - local ofdir = node.param2 or 0 - if side == "left" then - rside = "right" - nfdir=ofdir - 1 - if nfdir < 0 then nfdir = 3 end - else - rside = "left" - nfdir=ofdir + 1 - if nfdir > 3 then nfdir = 0 end - end - local sound = isClosed and 'close' or 'open' - minetest.sound_play("homedecor_door_"..sound, { - pos=pos, - max_hear_distance = 5, - gain = 2, - }) - -- XXX: does the top half have to remember open/closed too? - minetest.set_node({x=pos.x, y=pos.y+1, z=pos.z}, { name = "homedecor:door_"..name.."_top_"..rside, param2=nfdir}) - - addDoorNode(pos,{ name = "homedecor:door_"..name.."_bottom_"..rside, param2=nfdir },isClosed) -end - function homedecor.flip_gate(pos, node, player, gate, oc) - local isClosed = getClosed(pos); - minetest.sound_play("homedecor_gate_open_close", { - pos=pos, - max_hear_distance = 5, - gain = 2, - }) + local fdir = node.param2 or 0 - -- since right facing gates use "open" nodes for closed, we need an - -- isClosed flag to tell if it's "really" closed. - local gateresult if oc == "closed" then gateresult = "homedecor:gate_"..gate.."_open" @@ -508,12 +309,14 @@ function homedecor.flip_gate(pos, node, player, gate, oc) gateresult = "homedecor:gate_"..gate.."_closed" end - local def = {name=gateresult, param2=fdir} - - addDoorNode(pos, def, isClosed) + minetest.set_node(pos, {name = gateresult, param2 = fdir}) + minetest.sound_play("homedecor_gate_open_close", { + pos=pos, + max_hear_distance = 5, + gain = 2, + }) -- the following opens and closes gates below and above in sync with this one - -- (without three gate open/close sounds) local above = {x=pos.x, y=pos.y+1, z=pos.z} local below = {x=pos.x, y=pos.y-1, z=pos.z} @@ -521,69 +324,15 @@ function homedecor.flip_gate(pos, node, player, gate, oc) local nodebelow = minetest.get_node(below) if string.find(nodeabove.name, "homedecor:gate_"..gate) then - addDoorNode(above, def, isClosed) + minetest.set_node(above, {name = gateresult, param2 = fdir}) end if string.find(nodebelow.name, "homedecor:gate_"..gate) then - addDoorNode(below, def, isClosed) + minetest.set_node(below, {name = gateresult, param2 = fdir}) end end --- Japanese-style wood/paper wall pieces and door - -local jp_cbox = { - type = "fixed", - fixed = {-0.5, -0.5, 0, 0.5, 0.5, 0.0625}, -} - -minetest.register_node(":homedecor:japanese_wall_top", { - description = S("Japanese wall (top)"), - drawtype = "mesh", - mesh = "homedecor_wall_japanese_top.obj", - tiles = { - homedecor.lux_wood, - "homedecor_japanese_paper.png" - }, - paramtype = "light", - paramtype2 = "facedir", - groups = {snappy=3}, - selection_box = jp_cbox, - collision_box = jp_cbox, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node(":homedecor:japanese_wall_middle", { - description = S("Japanese wall"), - drawtype = "mesh", - mesh = "homedecor_wall_japanese_middle.obj", - tiles = { - homedecor.lux_wood, - "homedecor_japanese_paper.png" - }, - paramtype = "light", - paramtype2 = "facedir", - groups = {snappy=3}, - selection_box = jp_cbox, - collision_box = jp_cbox, - sounds = default.node_sound_wood_defaults(), -}) - -minetest.register_node(":homedecor:japanese_wall_bottom", { - description = S("Japanese wall (bottom)"), - drawtype = "mesh", - mesh = "homedecor_wall_japanese_bottom.obj", - tiles = { - homedecor.lux_wood, - "homedecor_japanese_paper.png" - }, - paramtype = "light", - paramtype2 = "facedir", - groups = {snappy=3}, - selection_box = jp_cbox, - collision_box = jp_cbox, - sounds = default.node_sound_wood_defaults(), -}) - +-- Japanese-style wood/paper door homedecor.register("door_japanese_closed", { description = S("Japanese-style door"), inventory_image = "homedecor_door_japanese_inv.png", @@ -636,6 +385,44 @@ homedecor.register("door_japanese_open", { -- crafting +-- half-doors + +minetest.register_craft( { + type = "shapeless", + output = "homedecor:gate_half_door_closed 4", + recipe = { + "homedecor:door_wood_plain_left", + "homedecor:door_wood_plain_left" + }, +}) + +minetest.register_craft( { + type = "shapeless", + output = "homedecor:gate_half_door_closed 4", + recipe = { + "homedecor:door_wood_plain_right", + "homedecor:door_wood_plain_right" + }, +}) + +minetest.register_craft( { + type = "shapeless", + output = "homedecor:gate_half_door_white_closed 4", + recipe = { + "homedecor:door_bedroom_left", + "homedecor:door_bedroom_left" + }, +}) + +minetest.register_craft( { + type = "shapeless", + output = "homedecor:gate_half_door_white_closed 4", + recipe = { + "homedecor:door_bedroom_right", + "homedecor:door_bedroom_right" + }, +}) + -- Gates minetest.register_craft( { @@ -882,3 +669,25 @@ minetest.register_alias("homedecor:jpn_door_bottom_open", "homedecor:door_japane minetest.register_alias("homedecor:door_glass_right", "doors:door_glass_b") minetest.register_alias("homedecor:door_glass_left", "doors:door_glass_a") + +-- flip old homedecor doors around, since they use minetest_game doors API now + +minetest.register_lbm({ + name = ":homedecor:convert_doors", + label = "Convert Homedecor doors to mtg doors API", + nodenames = old_doors, + run_at_every_load = false, + action = function(pos, node) + -- old doors param2: N=0, E=1, S=2, W=3 + local newparam2 = (node.param2 + 2) % 4 + local e = string.find(node.name, "_", -7) + local dir = string.sub(node.name, e+1) + local newname = "doors:"..string.sub(node.name, 16, e-1) + if dir == "right" then + minetest.set_node(pos, {name = newname.."_a", param2 = newparam2 }) + else + minetest.set_node(pos, {name = newname.."_b", param2 = newparam2 }) + end + minetest.set_node({x=pos.x, y=pos.y+1, z=pos.z}, {name = "doors:hidden"}) + end +}) diff --git a/homedecor_doors_and_gates/textures/homedecor_door_bedroom.png b/homedecor_doors_and_gates/textures/homedecor_door_bedroom.png index f94875fb..b2614b00 100644 Binary files a/homedecor_doors_and_gates/textures/homedecor_door_bedroom.png and b/homedecor_doors_and_gates/textures/homedecor_door_bedroom.png differ diff --git a/homedecor_doors_and_gates/textures/homedecor_door_closet_mahogany.png b/homedecor_doors_and_gates/textures/homedecor_door_closet_mahogany.png index e2f51f7b..4f696d4e 100644 Binary files a/homedecor_doors_and_gates/textures/homedecor_door_closet_mahogany.png and b/homedecor_doors_and_gates/textures/homedecor_door_closet_mahogany.png differ diff --git a/homedecor_doors_and_gates/textures/homedecor_door_closet_oak.png b/homedecor_doors_and_gates/textures/homedecor_door_closet_oak.png index 9355e850..53fd5565 100644 Binary files a/homedecor_doors_and_gates/textures/homedecor_door_closet_oak.png and b/homedecor_doors_and_gates/textures/homedecor_door_closet_oak.png differ diff --git a/homedecor_doors_and_gates/textures/homedecor_door_exterior_fancy.png b/homedecor_doors_and_gates/textures/homedecor_door_exterior_fancy.png index 9f89482d..b4a70ba7 100644 Binary files a/homedecor_doors_and_gates/textures/homedecor_door_exterior_fancy.png and b/homedecor_doors_and_gates/textures/homedecor_door_exterior_fancy.png differ diff --git a/homedecor_doors_and_gates/textures/homedecor_door_exterior_fancy_insert.png b/homedecor_doors_and_gates/textures/homedecor_door_exterior_fancy_insert.png deleted file mode 100644 index ddc5d228..00000000 Binary files a/homedecor_doors_and_gates/textures/homedecor_door_exterior_fancy_insert.png and /dev/null differ diff --git a/homedecor_doors_and_gates/textures/homedecor_door_wood_glass_insert.png b/homedecor_doors_and_gates/textures/homedecor_door_wood_glass_insert.png deleted file mode 100644 index 892f3067..00000000 Binary files a/homedecor_doors_and_gates/textures/homedecor_door_wood_glass_insert.png and /dev/null differ diff --git a/homedecor_doors_and_gates/textures/homedecor_door_wood_glass_mahogany.png b/homedecor_doors_and_gates/textures/homedecor_door_wood_glass_mahogany.png index ca0ca15d..b61fa6d2 100644 Binary files a/homedecor_doors_and_gates/textures/homedecor_door_wood_glass_mahogany.png and b/homedecor_doors_and_gates/textures/homedecor_door_wood_glass_mahogany.png differ diff --git a/homedecor_doors_and_gates/textures/homedecor_door_wood_glass_oak.png b/homedecor_doors_and_gates/textures/homedecor_door_wood_glass_oak.png index 0f087718..b1a5254d 100644 Binary files a/homedecor_doors_and_gates/textures/homedecor_door_wood_glass_oak.png and b/homedecor_doors_and_gates/textures/homedecor_door_wood_glass_oak.png differ diff --git a/homedecor_doors_and_gates/textures/homedecor_door_wood_glass_white.png b/homedecor_doors_and_gates/textures/homedecor_door_wood_glass_white.png index 202e600f..85b645e3 100644 Binary files a/homedecor_doors_and_gates/textures/homedecor_door_wood_glass_white.png and b/homedecor_doors_and_gates/textures/homedecor_door_wood_glass_white.png differ diff --git a/homedecor_doors_and_gates/textures/homedecor_door_wood_plain.png b/homedecor_doors_and_gates/textures/homedecor_door_wood_plain.png index 6b12552c..574d6fba 100644 Binary files a/homedecor_doors_and_gates/textures/homedecor_door_wood_plain.png and b/homedecor_doors_and_gates/textures/homedecor_door_wood_plain.png differ diff --git a/homedecor_doors_and_gates/textures/homedecor_door_woodglass.png b/homedecor_doors_and_gates/textures/homedecor_door_woodglass.png new file mode 100644 index 00000000..b3187ff4 Binary files /dev/null and b/homedecor_doors_and_gates/textures/homedecor_door_woodglass.png differ diff --git a/homedecor_doors_and_gates/textures/homedecor_door_woodglass2.png b/homedecor_doors_and_gates/textures/homedecor_door_woodglass2.png index ee8ca2be..7dc3918f 100644 Binary files a/homedecor_doors_and_gates/textures/homedecor_door_woodglass2.png and b/homedecor_doors_and_gates/textures/homedecor_door_woodglass2.png differ diff --git a/homedecor_doors_and_gates/textures/homedecor_door_woodglass_typea.png b/homedecor_doors_and_gates/textures/homedecor_door_woodglass_typea.png deleted file mode 100644 index 2d5902ad..00000000 Binary files a/homedecor_doors_and_gates/textures/homedecor_door_woodglass_typea.png and /dev/null differ diff --git a/homedecor_doors_and_gates/textures/homedecor_door_woodglass_typea_insert.png b/homedecor_doors_and_gates/textures/homedecor_door_woodglass_typea_insert.png deleted file mode 100644 index 12fb2c64..00000000 Binary files a/homedecor_doors_and_gates/textures/homedecor_door_woodglass_typea_insert.png and /dev/null differ diff --git a/homedecor_doors_and_gates/textures/homedecor_door_wrought_iron.png b/homedecor_doors_and_gates/textures/homedecor_door_wrought_iron.png index e39b46a9..c2034c32 100644 Binary files a/homedecor_doors_and_gates/textures/homedecor_door_wrought_iron.png and b/homedecor_doors_and_gates/textures/homedecor_door_wrought_iron.png differ diff --git a/homedecor_electrical/depends.txt b/homedecor_electrical/depends.txt index fb5d6010..382015ec 100644 --- a/homedecor_electrical/depends.txt +++ b/homedecor_electrical/depends.txt @@ -1,3 +1,5 @@ homedecor_common default basic_materials +mesecons? +mesecons_receiver? diff --git a/homedecor_electrical/init.lua b/homedecor_electrical/init.lua index c135021a..53c7fbb0 100644 --- a/homedecor_electrical/init.lua +++ b/homedecor_electrical/init.lua @@ -1,6 +1,40 @@ local S = homedecor.gettext +function homedecor.toggle_switch(pos, node, clicker, itemstack, pointed_thing) + if minetest.is_protected(pos, clicker:get_player_name()) then + minetest.record_protection_violation(pos, + sender:get_player_name()) + return false + end + local sep = string.find(node.name, "_o", -5) + local onoff = string.sub(node.name, sep + 1) + local newname = string.sub(node.name, 1, sep - 1)..((onoff == "off") and "_on" or "_off") + minetest.swap_node(pos, {name = newname, param2 = node.param2}) + return true +end + +local on_rc +local switch_receptor + +if minetest.get_modpath("mesecons") then + on_rc = function(pos, node, clicker, itemstack, pointed_thing) + local t = homedecor.toggle_switch(pos, node, clicker, itemstack, pointed_thing) + if not t then return end + if string.find(node.name, "_on", -5) then + mesecon.receptor_off(pos, mesecon.rules.buttonlike_get(node)) + else + mesecon.receptor_on(pos, mesecon.rules.buttonlike_get(node)) + end + end + switch_receptor = { + receptor = { + state = mesecon.state[onoff], + rules = mesecon.rules.buttonlike_get + } + } +end + homedecor.register("power_outlet", { description = S("Power Outlet"), tiles = { @@ -28,35 +62,52 @@ homedecor.register("power_outlet", { walkable = false }) -homedecor.register("light_switch", { - description = S("Light switch"), - tiles = { - "homedecor_light_switch_edges.png", - "homedecor_light_switch_edges.png", - "homedecor_light_switch_edges.png", - "homedecor_light_switch_edges.png", - "homedecor_light_switch_back.png", - "homedecor_light_switch_front.png" - }, - inventory_image = "homedecor_light_switch_inv.png", - node_box = { - type = "fixed", - fixed = { - { -0.125, -0.5, 0.4375, 0.125, -0.1875, 0.5 }, - { -0.03125, -0.3125, 0.40625, 0.03125, -0.25, 0.5 }, +for _, onoff in ipairs ({"on", "off"}) do - } - }, - selection_box = { - type = "fixed", - fixed = { - { -0.1875, -0.5625, 0.375, 0.1875, -0.1250, 0.5 }, - } - }, - groups = {cracky=3,dig_immediate=2}, - walkable = false -}) + local model = { + { -0.125, -0.1875, 0.4375, 0.125, 0.125, 0.5 }, + { -0.03125, 0, 0.40625, 0.03125, 0.0625, 0.5 }, + } + if onoff == "on" then + model = { + { -0.125, -0.1875, 0.4375, 0.125, 0.125, 0.5 }, + { -0.03125, -0.125, 0.40625, 0.03125, -0.0625, 0.5 }, + } + end + + homedecor.register("light_switch_"..onoff, { + description = S("Light switch"), + tiles = { + "homedecor_light_switch_edges.png", + "homedecor_light_switch_edges.png", + "homedecor_light_switch_edges.png", + "homedecor_light_switch_edges.png", + "homedecor_light_switch_back.png", + "homedecor_light_switch_front_"..onoff..".png" + }, + inventory_image = "homedecor_light_switch_inv.png", + node_box = { + type = "fixed", + fixed = model + }, + selection_box = { + type = "fixed", + fixed = { + { -0.1875, -0.25, 0.375, 0.1875, 0.1875, 0.5 }, + } + }, + groups = {cracky=3, dig_immediate=2, mesecon_needs_receiver=1, not_in_creative_inventory = (onoff == "on") and 1 or nil}, + walkable = false, + drop = { + items = { + {items = {"homedecor:light_switch_off"}, inherit_color = true }, + } + }, + mesecons = switch_receptor, + on_rightclick = on_rc + }) +end homedecor.register("doorbell", { tiles = { "homedecor_doorbell.png" }, @@ -92,7 +143,7 @@ minetest.register_craft( { }) minetest.register_craft( { - output = "homedecor:light_switch", + output = "homedecor:light_switch_off", recipe = { {"", "basic_materials:plastic_sheet", "basic_materials:copper_strip"}, {"basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:copper_strip"}, @@ -106,3 +157,7 @@ minetest.register_craft( { { "homedecor:light_switch", "basic_materials:energy_crystal_simple", "homedecor:speaker_driver" } }, }) + +-- aliases + +minetest.register_alias("homedecor:light_switch", "homedecor:light_switch_on") diff --git a/homedecor_electrical/textures/homedecor_light_switch_back.png b/homedecor_electrical/textures/homedecor_light_switch_back.png index 8ad7c7ea..f3357d1d 100644 Binary files a/homedecor_electrical/textures/homedecor_light_switch_back.png and b/homedecor_electrical/textures/homedecor_light_switch_back.png differ diff --git a/homedecor_electrical/textures/homedecor_light_switch_edges.png b/homedecor_electrical/textures/homedecor_light_switch_edges.png index 0db6f431..db6d618e 100644 Binary files a/homedecor_electrical/textures/homedecor_light_switch_edges.png and b/homedecor_electrical/textures/homedecor_light_switch_edges.png differ diff --git a/homedecor_electrical/textures/homedecor_light_switch_front.png b/homedecor_electrical/textures/homedecor_light_switch_front.png deleted file mode 100644 index f91ab5e3..00000000 Binary files a/homedecor_electrical/textures/homedecor_light_switch_front.png and /dev/null differ diff --git a/homedecor_electrical/textures/homedecor_light_switch_front_off.png b/homedecor_electrical/textures/homedecor_light_switch_front_off.png new file mode 100644 index 00000000..eecc8b35 Binary files /dev/null and b/homedecor_electrical/textures/homedecor_light_switch_front_off.png differ diff --git a/homedecor_electrical/textures/homedecor_light_switch_front_on.png b/homedecor_electrical/textures/homedecor_light_switch_front_on.png new file mode 100644 index 00000000..1b6c3f60 Binary files /dev/null and b/homedecor_electrical/textures/homedecor_light_switch_front_on.png differ diff --git a/homedecor_kitchen/init.lua b/homedecor_kitchen/init.lua index 56cc9c75..905fecc8 100644 --- a/homedecor_kitchen/init.lua +++ b/homedecor_kitchen/init.lua @@ -425,13 +425,12 @@ minetest.register_craft({ } }) - minetest.register_craft( { output = "homedecor:dishwasher", recipe = { - { "basic_materials:ic", "homedecor:fence_chainlink", "default:steel_ingot", }, - { "default:steel_ingot", "homedecor:shower_head", "basic_materials:motor" }, - { "default:steel_ingot", "basic_materials:heating_element", "bucket:bucket_water" } + { "basic_materials:ic", "building_blocks:slab_grate_1", "default:steel_ingot", }, + { "default:steel_ingot", "homedecor:shower_head", "basic_materials:motor" }, + { "default:steel_ingot", "basic_materials:heating_element", "bucket:bucket_water" } }, }) @@ -517,6 +516,15 @@ minetest.register_craft( { }, }) +minetest.register_craft( { + output = "homedecor:kitchen_faucet", + recipe = { + { "default:steel_ingot","" }, + { "", "default:steel_ingot" }, + { "", "homedecor:taps" } + }, +}) + minetest.register_craft( { output = "homedecor:cutlery_set", recipe = { diff --git a/homedecor_lighting/depends.txt b/homedecor_lighting/depends.txt index 67304af7..cc756490 100644 --- a/homedecor_lighting/depends.txt +++ b/homedecor_lighting/depends.txt @@ -6,3 +6,4 @@ creative moreblocks? building_blocks? darkage? +mesecons? diff --git a/homedecor_lighting/init.lua b/homedecor_lighting/init.lua index dcca5ab8..319ad9e7 100644 --- a/homedecor_lighting/init.lua +++ b/homedecor_lighting/init.lua @@ -1,171 +1,693 @@ --- This file supplies glowlights +-- This file supplies the majority of homedecor's lighting local S = homedecor.gettext -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 } - }, +local actions = { + action_off = function(pos, node) + local sep = string.find(node.name, "_o", -5) + local onoff = string.sub(node.name, sep + 1) + if minetest.get_meta(pos):get_int("toggled") > 0 then + minetest.swap_node(pos, { + name = string.sub(node.name, 1, sep - 1).."_off", + param2 = node.param2 + }) + end + end, + action_on = function(pos, node) + minetest.get_meta(pos):set_int("toggled", 1) + local sep = string.find(node.name, "_o", -5) + local onoff = string.sub(node.name, sep + 1) + minetest.swap_node(pos, { + name = string.sub(node.name, 1, sep - 1).."_on", + param2 = node.param2 + }) + end } -minetest.register_node(":homedecor:glowlight_half", { - 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" - }, - 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, - drawtype = "nodebox", - paramtype = "light", - paramtype2 = "colorwallmounted", - palette = "unifieddyes_palette_colorwallmounted.png", - 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 } - }, - node_box = glowlight_nodebox.half, - groups = { snappy = 3, ud_param2_colorable = 1 }, - light_source = default.LIGHT_MAX, - sounds = default.node_sound_glass_defaults(), - after_place_node = function(pos, placer, itemstack, pointed_thing) - unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing) - end, -}) +local rules_xz = { + {x = -1, y = 0, z = 0}, -- borrowed from extrawires crossing + {x = 1, y = 0, z = 0}, + {x = 0, y = 0, z = -1}, + {x = 0, y = 0, z = 1}, +} -minetest.register_node(":homedecor:glowlight_quarter", { - 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" - }, - 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, - drawtype = "nodebox", - paramtype = "light", - paramtype2 = "colorwallmounted", - palette = "unifieddyes_palette_colorwallmounted.png", - 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 } - }, - node_box = glowlight_nodebox.quarter, - groups = { snappy = 3, ud_param2_colorable = 1 }, - light_source = default.LIGHT_MAX-1, - sounds = default.node_sound_glass_defaults(), - after_place_node = function(pos, placer, itemstack, pointed_thing) - unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing) - end, -}) +local rules_alldir = { + {x = 0, y = 0, z = -1}, -- borrowed from lightstones + {x = 1, y = 0, z = 0}, + {x = -1, y = 0, z = 0}, + {x = 0, y = 0, z = 1}, + {x = 1, y = 1, z = 0}, + {x = 1, y = -1, z = 0}, + {x = -1, y = 1, z = 0}, + {x = -1, y = -1, z = 0}, + {x = 0, y = 1, z = 1}, + {x = 0, y = -1, z = 1}, + {x = 0, y = 1, z = -1}, + {x = 0, y = -1, z = -1}, + {x = 0, y = -1, z = 0}, +} -minetest.register_node(":homedecor:glowlight_small_cube", { - 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" - }, - 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, - paramtype = "light", - paramtype2 = "colorwallmounted", - drawtype = "nodebox", - palette = "unifieddyes_palette_colorwallmounted.png", - 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 } - }, - node_box = glowlight_nodebox.small_cube, - groups = { snappy = 3, ud_param2_colorable = 1 }, - light_source = default.LIGHT_MAX-1, - sounds = default.node_sound_glass_defaults(), - after_place_node = function(pos, placer, itemstack, pointed_thing) - unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing) - end, -}) +local rules_toponly = { + {x = 1, y = 1, z = 0}, + {x = -1, y = 1, z = 0}, + {x = 0, y = 1, z = 1}, + {x = 0, y = 1, z = -1}, +} -homedecor.register("plasma_lamp", { - description = S("Plasma Lamp/Light"), - drawtype = "mesh", - mesh = "plasma_lamp.obj", - tiles = { - "default_gold_block.png", - { +if minetest.get_modpath("mesecons") then + homedecor.mesecon_wall_light = { + effector = table.copy(actions) + } + homedecor.mesecon_wall_light.effector.rules = mesecon.rules.wallmounted_get + + homedecor.mesecon_xz_light = { + effector = table.copy(actions) + } + homedecor.mesecon_xz_light.effector.rules = rules_xz + + homedecor.mesecon_alldir_light = { + effector = table.copy(actions), + } + homedecor.mesecon_alldir_light.effector.rules = rules_alldir + + homedecor.mesecon_toponly_light = { + effector = table.copy(actions) + } + homedecor.mesecon_toponly_light.effector.rules = rules_toponly + +end + +local brightness_tab = { + 0xffd0d0d0, + 0xffd8d8d8, + 0xffe0e0e0, + 0xffe8e8e8, + 0xffffffff, +} + +function homedecor.toggle_light(pos, node, clicker, itemstack, pointed_thing) + if minetest.is_protected(pos, clicker:get_player_name()) then + minetest.record_protection_violation(pos, + sender:get_player_name()) + return + end + local sep = string.find(node.name, "_o", -5) + local onoff = string.sub(node.name, sep + 1) + local newname = string.sub(node.name, 1, sep - 1)..((onoff == "off") and "_on" or "_off") + minetest.swap_node(pos, {name = newname, param2 = node.param2}) +end + +for _, onoff in ipairs({"on", "off"}) do + + local onflag = (onoff == "on") + local offon = "on" -- always the inverse of 'onoff' + if onoff == "on" then offon = "off" end + + local tiles + local overlay + local nici + if not onflag then nici = 1 end + + 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 } + }, + } + + local base = "homedecor_glowlight_base.png" + + local tb_edges = "homedecor_glowlight_tb_edges.png" + local sides_edges = "homedecor_glowlight_thick_sides_edges.png" + local sides_glare = "homedecor_glowlight_thick_sides_glare.png" + + if onflag then + tiles = { + "("..base.."^"..tb_edges..")^[brighten", + "("..base.."^"..tb_edges..")^[brighten", + "("..base.."^"..sides_edges..")^[brighten", + "("..base.."^"..sides_edges..")^[brighten", + "("..base.."^"..sides_edges..")^[brighten", + "("..base.."^"..sides_edges..")^[brighten", + } + overlay = { + { name = "homedecor_glowlight_top_glare.png", color = "white"}, + "", + { name = sides_glare, color = "white"}, + { name = sides_glare, color = "white"}, + { name = sides_glare, color = "white"}, + { name = sides_glare, color = "white"}, + } + else + tiles = { + base.."^"..tb_edges, + base.."^"..tb_edges, + base.."^"..sides_edges, + base.."^"..sides_edges, + base.."^"..sides_edges, + base.."^"..sides_edges, + } + overlay = nil + end + + minetest.register_node(":homedecor:glowlight_half_"..onoff, { + description = S("Thick Glowlight"), + tiles = tiles, + overlay_tiles = overlay, + use_texture_alpha = true, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "colorwallmounted", + palette = "unifieddyes_palette_colorwallmounted.png", + 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 } + }, + node_box = glowlight_nodebox.half, + groups = { snappy = 3, ud_param2_colorable = 1, not_in_creative_inventory = nici }, + light_source = onflag and default.LIGHT_MAX or nil, + sounds = default.node_sound_glass_defaults(), + after_place_node = function(pos, placer, itemstack, pointed_thing) + unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing) + end, + on_rightclick = homedecor.toggle_light, + drop = { + items = { + {items = {"homedecor:glowlight_half_on"}, inherit_color = true }, + } + }, + mesecons = homedecor.mesecon_wall_light + }) + + sides_edges = "homedecor_glowlight_thin_sides_edges.png" + sides_glare = "homedecor_glowlight_thin_sides_glare.png" + + if onflag then + tiles = { + "("..base.."^"..tb_edges..")^[brighten", + "("..base.."^"..tb_edges..")^[brighten", + "("..base.."^"..sides_edges..")^[brighten", + "("..base.."^"..sides_edges..")^[brighten", + "("..base.."^"..sides_edges..")^[brighten", + "("..base.."^"..sides_edges..")^[brighten", + } + overlay = { + { name = "homedecor_glowlight_top_glare.png", color = "white"}, + "", + { name = sides_glare, color = "white"}, + { name = sides_glare, color = "white"}, + { name = sides_glare, color = "white"}, + { name = sides_glare, color = "white"}, + } + else + tiles = { + base.."^"..tb_edges, + base.."^"..tb_edges, + base.."^"..sides_edges, + base.."^"..sides_edges, + base.."^"..sides_edges, + base.."^"..sides_edges, + } + overlay = nil + end + + minetest.register_node(":homedecor:glowlight_quarter_"..onoff, { + description = S("Thin Glowlight"), + tiles = tiles, + overlay_tiles = overlay, + use_texture_alpha = true, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "colorwallmounted", + palette = "unifieddyes_palette_colorwallmounted.png", + 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 } + }, + node_box = glowlight_nodebox.quarter, + groups = { snappy = 3, ud_param2_colorable = 1, not_in_creative_inventory = nici }, + light_source = onflag and (default.LIGHT_MAX - 1) or nil, + sounds = default.node_sound_glass_defaults(), + after_place_node = function(pos, placer, itemstack, pointed_thing) + unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing) + end, + on_rightclick = homedecor.toggle_light, + drop = { + items = { + {items = {"homedecor:glowlight_quarter_on"}, inherit_color = true }, + } + }, + mesecons = homedecor.mesecon_wall_light + }) + + tb_edges = "homedecor_glowlight_cube_tb_edges.png" + sides_edges = "homedecor_glowlight_cube_sides_edges.png" + sides_glare = "homedecor_glowlight_cube_sides_glare.png" + + if onflag then + tiles = { + "("..base.."^"..tb_edges..")^[brighten", + "("..base.."^"..tb_edges..")^[brighten", + "("..base.."^"..sides_edges..")^[brighten", + "("..base.."^"..sides_edges..")^[brighten", + "("..base.."^"..sides_edges..")^[brighten", + "("..base.."^"..sides_edges..")^[brighten", + } + overlay = { + { name = "homedecor_glowlight_cube_top_glare.png", color = "white"}, + "", + { name = sides_glare, color = "white"}, + { name = sides_glare, color = "white"}, + { name = sides_glare, color = "white"}, + { name = sides_glare, color = "white"}, + } + else + tiles = { + base.."^"..tb_edges, + base.."^"..tb_edges, + base.."^"..sides_edges, + base.."^"..sides_edges, + base.."^"..sides_edges, + base.."^"..sides_edges, + } + overlay = nil + end + + minetest.register_node(":homedecor:glowlight_small_cube_"..onoff, { + description = S("Small Glowlight Cube"), + tiles = tiles, + overlay_tiles = overlay, + use_texture_alpha = true, + paramtype = "light", + paramtype2 = "colorwallmounted", + drawtype = "nodebox", + palette = "unifieddyes_palette_colorwallmounted.png", + 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 } + }, + node_box = glowlight_nodebox.small_cube, + groups = { snappy = 3, ud_param2_colorable = 1, not_in_creative_inventory = nici }, + light_source = onflag and (default.LIGHT_MAX - 1) or nil, + sounds = default.node_sound_glass_defaults(), + after_place_node = function(pos, placer, itemstack, pointed_thing) + unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing) + end, + on_rightclick = homedecor.toggle_light, + drop = { + items = { + {items = {"homedecor:glowlight_small_cube_on"}, inherit_color = true }, + } + }, + mesecons = homedecor.mesecon_wall_light + }) + + local lighttex + + if onflag then + lighttex = { name="homedecor_plasma_storm.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}, } - }, - use_texture_alpha = true, - light_source = default.LIGHT_MAX - 1, - sunlight_propagates = true, - groups = {cracky=3,oddly_breakable_by_hand=3}, - sounds = default.node_sound_glass_defaults(), -}) + else + lighttex = "homedecor_plasma_lamp_off.png" + end -homedecor.register("plasma_ball", { - description = S("Plasma Ball"), - mesh = "homedecor_plasma_ball.obj", - tiles = { - { name = "homedecor_generic_plastic.png", color = homedecor.color_black }, - { + homedecor.register("plasma_lamp_"..onoff, { + description = S("Plasma Lamp/Light"), + drawtype = "mesh", + mesh = "plasma_lamp.obj", + tiles = { + "default_gold_block.png", + lighttex + }, + use_texture_alpha = true, + light_source = onflag and (default.LIGHT_MAX - 1) or nil, + sunlight_propagates = true, + groups = {cracky=3, oddly_breakable_by_hand=3, not_in_creative_inventory = nici}, + sounds = default.node_sound_glass_defaults(), + on_rightclick = homedecor.toggle_light, + drop = { + items = { + {items = {"homedecor:plasma_lamp_on"}}, + } + }, + mesecons = homedecor.mesecon_alldir_light + }) + + local lighttex = "homedecor_blanktile.png" + if onflag then + lighttex = { name = "homedecor_plasma_ball_streamers.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}, + } + end + + homedecor.register("plasma_ball_"..onoff, { + description = S("Plasma Ball"), + mesh = "homedecor_plasma_ball.obj", + tiles = { + { name = "homedecor_generic_plastic.png", color = homedecor.color_black }, + lighttex, + "homedecor_plasma_ball_glass.png" }, - "homedecor_plasma_ball_glass.png" - }, - inventory_image = "homedecor_plasma_ball_inv.png", - selection_box = { + inventory_image = "homedecor_plasma_ball_inv.png", + selection_box = { + type = "fixed", + fixed = { -0.1875, -0.5, -0.1875, 0.1875, 0, 0.1875 } + }, + walkable = false, + use_texture_alpha = true, + light_source = onflag and (default.LIGHT_MAX - 5) or nil, + sunlight_propagates = true, + groups = {cracky=3, oddly_breakable_by_hand=3, not_in_creative_inventory = nici}, + sounds = default.node_sound_glass_defaults(), + on_rightclick = homedecor.toggle_light, + drop = { + items = { + {items = {"homedecor:plasma_ball_on"}}, + } + }, + mesecons = homedecor.mesecon_xz_light + }) + + local gl_cbox = { type = "fixed", - fixed = { -0.1875, -0.5, -0.1875, 0.1875, 0, 0.1875 } - }, - walkable = false, - use_texture_alpha = true, - light_source = default.LIGHT_MAX - 5, - sunlight_propagates = true, - groups = {cracky=3,oddly_breakable_by_hand=3}, - sounds = default.node_sound_glass_defaults(), -}) + fixed = { -0.25, -0.5, -0.25, 0.25, 0.45, 0.25 }, + } + + local lighttex + if onflag then + lighttex = "homedecor_light.png" + else + lighttex = "homedecor_table_generic_light_source_off.png" + end + + homedecor.register("ground_lantern_"..onoff, { + description = S("Ground Lantern/Light"), + mesh = "homedecor_ground_lantern.obj", + tiles = { lighttex, "homedecor_generic_metal_wrought_iron.png" }, + use_texture_alpha = true, + inventory_image = "homedecor_ground_lantern_inv.png", + wield_image = "homedecor_ground_lantern_inv.png", + groups = {snappy=3, not_in_creative_inventory = nici}, + light_source = onflag and (default.LIGHT_MAX - 3) or nil, + selection_box = gl_cbox, + walkable = false, + on_rightclick = homedecor.toggle_light, + drop = { + items = { + {items = {"homedecor:ground_lantern_on"}}, + } + }, + mesecons = homedecor.mesecon_xz_light + }) + + local hl_cbox = { + type = "fixed", + fixed = { -0.25, -0.5, -0.2, 0.25, 0.5, 0.5 }, + } + + homedecor.register("hanging_lantern_"..onoff, { + description = S("Hanging Lantern/Light"), + mesh = "homedecor_hanging_lantern.obj", + tiles = { "homedecor_generic_metal_wrought_iron.png", lighttex }, + use_texture_alpha = true, + inventory_image = "homedecor_hanging_lantern_inv.png", + wield_image = "homedecor_hanging_lantern_inv.png", + groups = {snappy=3, not_in_creative_inventory = nici}, + light_source = onflag and (default.LIGHT_MAX - 3) or nil, + selection_box = hl_cbox, + walkable = false, + on_rightclick = homedecor.toggle_light, + drop = { + items = { + {items = {"homedecor:hanging_lantern_on"}}, + } + }, + mesecons = homedecor.mesecon_alldir_light + }) + + local cl_cbox = { + type = "fixed", + fixed = { -0.35, -0.45, -0.35, 0.35, 0.5, 0.35 } + } + + homedecor.register("ceiling_lantern_"..onoff, { + drawtype = "mesh", + mesh = "homedecor_ceiling_lantern.obj", + tiles = { lighttex, "homedecor_generic_metal_wrought_iron.png" }, + use_texture_alpha = true, + inventory_image = "homedecor_ceiling_lantern_inv.png", + description = S("Ceiling Lantern/Light"), + groups = {snappy=3, not_in_creative_inventory = nici}, + light_source = onflag and (default.LIGHT_MAX - 3) or nil, + selection_box = cl_cbox, + walkable = false, + on_rightclick = homedecor.toggle_light, + drop = { + items = { + {items = {"homedecor:ceiling_lantern_on"}}, + } + }, + mesecons = homedecor.mesecon_toponly_light + }) + + if minetest.get_modpath("darkage") then + sm_light = default.LIGHT_MAX-5 + else + local lighttex + if onflag then + lighttex = "homedecor_lattice_lantern_large_light.png" + else + lighttex = "homedecor_table_generic_light_source_off.png" + end + + homedecor.register("lattice_lantern_large_"..onoff, { + description = S("Lattice lantern/Light (large)"), + tiles = { lighttex.."^homedecor_lattice_lantern_large_overlay.png" }, + groups = { snappy = 3, not_in_creative_inventory = nici }, + light_source = onflag and default.LIGHT_MAX or nil, + sounds = default.node_sound_glass_defaults(), + on_rightclick = homedecor.toggle_light, + drop = { + items = { + {items = {"homedecor:lattice_lantern_large_on"}}, + } + }, + mesecons = homedecor.mesecon_alldir_light + }) + end + + local lighttex_tb + local lighttex_sides + + if onflag then + 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" + end + + homedecor.register("lattice_lantern_small_"..onoff, { + description = S("Lattice lantern/light (small)"), + tiles = { + lighttex_tb.."^homedecor_lattice_lantern_small_tb_overlay.png", + lighttex_tb.."^homedecor_lattice_lantern_small_tb_overlay.png", + lighttex_sides.."^homedecor_lattice_lantern_small_sides_overlay.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 } + }, + groups = { snappy = 3, not_in_creative_inventory = nici }, + light_source = onflag and (default.LIGHT_MAX - 2) or nil, + sounds = default.node_sound_glass_defaults(), + on_place = minetest.rotate_node, + on_rightclick = homedecor.toggle_light, + drop = { + items = { + {items = {"homedecor:lattice_lantern_small_on"}}, + } + }, + mesecons = homedecor.mesecon_wall_light + }) + + -- "gooseneck" style desk lamps + + local dlamp_cbox = { + type = "wallmounted", + wall_side = { -0.2, -0.5, -0.15, 0.32, 0.12, 0.15 }, + } + + homedecor.register("desk_lamp_"..onoff, { + description = S("Desk Lamp/Light"), + 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_generic_light_source_"..onoff..".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, + groups = {snappy=3, ud_param2_colorable = 1, not_in_creative_inventory = nici}, + after_place_node = function(pos, placer, itemstack, pointed_thing) + unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing) + end, + on_rotate = unifieddyes.fix_after_screwdriver_nsew, + light_source = onflag and (default.LIGHT_MAX - 2) or nil, + on_rightclick = homedecor.toggle_light, + drop = { + items = { + {items = {"homedecor:desk_lamp_on"}, inherit_color = true }, + } + }, + mesecons = homedecor.mesecon_xz_light + }) + + -- "kitchen"/"dining room" ceiling lamp + + homedecor.register("ceiling_lamp_"..onoff, { + description = S("Ceiling Lamp/Light"), + mesh = "homedecor_ceiling_lamp.obj", + tiles = { + "homedecor_generic_metal_brass.png", + "homedecor_ceiling_lamp_glass.png", + "homedecor_table_generic_light_source_"..onoff..".png", + { name = "homedecor_generic_plastic.png", color = 0xff442d04 }, + }, + inventory_image = "homedecor_ceiling_lamp_inv.png", + light_source = onflag and default.LIGHT_MAX or nil, + groups = {snappy=3, not_in_creative_inventory = nici}, + walkable = false, + on_rightclick = homedecor.toggle_light, + drop = { + items = { + {items = {"homedecor:ceiling_lamp_on"}}, + } + }, + mesecons = homedecor.mesecon_toponly_light + }) + +-- rope lighting + + minetest.register_node(":homedecor:rope_light_on_floor_"..onoff, { + description = "Rope lighting (on floor)", + inventory_image = "homedecor_rope_light_on_floor.png", + paramtype = "light", + light_source = onflag and (default.LIGHT_MAX - 3) or nil, + walkable = false, + sunlight_propagates = true, + tiles = { "homedecor_table_generic_light_source_"..onoff..".png" }, + drawtype = "nodebox", + node_box = { + type = "connected", + fixed = {}, + connect_front = { -1/16, -8/16, -8/16, 1/16, -6/16, 1/16 }, + connect_left = { -8/16, -8/16, -1/16, 1/16, -6/16, 1/16 }, + connect_back = { -1/16, -8/16, -1/16, 1/16, -6/16, 8/16 }, + connect_right = { -1/16, -8/16, -1/16, 8/16, -6/16, 1/16 }, + disconnected_sides = { + { -6/16, -8/16, -6/16, -4/16, -6/16, 6/16 }, + { 4/16, -8/16, -6/16, 6/16, -6/16, 6/16 }, + { -6/16, -8/16, -6/16, 6/16, -6/16, -4/16 }, + { -6/16, -8/16, 4/16, 6/16, -6/16, 6/16 } + }, + }, + connects_to = { + "homedecor:rope_light_on_floor_on", + "homedecor:rope_light_on_floor_off", + "group:mesecon_conductor_craftable" + }, + mesh = "homedecor_chandelier.obj", + groups = {cracky=3, not_in_creative_inventory = nici}, + sounds = default.node_sound_stone_defaults(), + on_rightclick = homedecor.toggle_light, + drop = { + items = { + {items = {"homedecor:rope_light_on_floor_on"} }, + } + }, + mesecons = { + conductor = { + state = mesecon and (onflag and mesecon.state.on or mesecon.state.off), + onstate = "homedecor:rope_light_on_floor_on", + offstate = "homedecor:rope_light_on_floor_off", + rules = rules_xz + }, + } + }) + + minetest.register_node(":homedecor:rope_light_on_ceiling_"..onoff, { + description = "Rope lighting (on ceiling)", + inventory_image = "homedecor_rope_light_on_ceiling.png", + paramtype = "light", + light_source = onflag and (default.LIGHT_MAX - 3) or nil, + walkable = false, + sunlight_propagates = true, + tiles = { "homedecor_table_generic_light_source_"..onoff..".png" }, + drawtype = "nodebox", + node_box = { + type = "connected", + fixed = {}, + connect_front = { -1/16, 8/16, -8/16, 1/16, 6/16, 1/16 }, + connect_left = { -8/16, 8/16, -1/16, 1/16, 6/16, 1/16 }, + connect_back = { -1/16, 8/16, -1/16, 1/16, 6/16, 8/16 }, + connect_right = { -1/16, 8/16, -1/16, 8/16, 6/16, 1/16 }, + disconnected_sides = { + { -6/16, 8/16, -6/16, -4/16, 6/16, 6/16 }, + { 4/16, 8/16, -6/16, 6/16, 6/16, 6/16 }, + { -6/16, 8/16, -6/16, 6/16, 6/16, -4/16 }, + { -6/16, 8/16, 4/16, 6/16, 6/16, 6/16 } + }, + }, + connects_to = { + "homedecor:rope_light_on_ceiling_on", + "homedecor:rope_light_on_ceiling_off", + "group:mesecon_conductor_craftable" + }, + mesh = "homedecor_chandelier.obj", + groups = {cracky=3, not_in_creative_inventory = nici}, + sounds = default.node_sound_stone_defaults(), + on_rightclick = homedecor.toggle_light, + drop = { + items = { + {items = {"homedecor:rope_light_on_ceiling_on"}}, + } + }, + mesecons = { + conductor = { + state = mesecon and (onflag and mesecon.state.on or mesecon.state.off), + onstate = "homedecor:rope_light_on_ceiling_on", + offstate = "homedecor:rope_light_on_ceiling_off", + rules = rules_alldir + }, + } + }) + +end + +-- Light sources and other items that either don't turn on/off +-- or which need special light-control code. local tc_cbox = { type = "fixed", @@ -304,105 +826,98 @@ homedecor.register("oil_lamp_tabletop", { sounds = default.node_sound_glass_defaults(), }) -local gl_cbox = { +local chains_sbox = { type = "fixed", - fixed = { -0.25, -0.5, -0.25, 0.25, 0.45, 0.25 }, + fixed = { -0.1, -0.5, -0.1, 0.1, 0.5, 0.1 } } -minetest.register_alias("homedecor:wall_lantern", "homedecor:ground_lantern") - -homedecor.register("ground_lantern", { - description = S("Ground Lantern/Light"), - mesh = "homedecor_ground_lantern.obj", - tiles = { "homedecor_light.png", "homedecor_generic_metal_wrought_iron.png" }, - use_texture_alpha = true, - inventory_image = "homedecor_ground_lantern_inv.png", - wield_image = "homedecor_ground_lantern_inv.png", - groups = {snappy=3}, - light_source = 11, - selection_box = gl_cbox, - walkable = false -}) - -local hl_cbox = { +local topchains_sbox = { type = "fixed", - fixed = { -0.25, -0.5, -0.2, 0.25, 0.5, 0.5 }, + 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 } + } } -homedecor.register("hanging_lantern", { - description = S("Hanging Lantern/Light"), - mesh = "homedecor_hanging_lantern.obj", - tiles = { "homedecor_generic_metal_wrought_iron.png", "homedecor_light.png" }, - use_texture_alpha = true, - inventory_image = "homedecor_hanging_lantern_inv.png", - wield_image = "homedecor_hanging_lantern_inv.png", - groups = {snappy=3}, - light_source = 11, - selection_box = hl_cbox, - walkable = false -}) - -local cl_cbox = { - type = "fixed", - fixed = { -0.35, -0.45, -0.35, 0.35, 0.5, 0.35 } -} - -homedecor.register("ceiling_lantern", { +minetest.register_node(":homedecor:chain_steel_top", { + description = S("Hanging chain (ceiling mount, steel)"), drawtype = "mesh", - mesh = "homedecor_ceiling_lantern.obj", - tiles = { "homedecor_light.png", "homedecor_generic_metal_wrought_iron.png" }, - use_texture_alpha = true, - inventory_image = "homedecor_ceiling_lantern_inv.png", - description = S("Ceiling Lantern/Light"), - groups = {snappy=3}, - light_source = 11, - selection_box = cl_cbox, - walkable = false + 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, }) -local sm_light = default.LIGHT_MAX-2 +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, +}) -if minetest.get_modpath("darkage") then - minetest.register_alias("homedecor:lattice_lantern_large", "darkage:lamp") - sm_light = default.LIGHT_MAX-5 -else - homedecor.register("lattice_lantern_large", { - description = S("Lattice lantern/Light (large)"), - tiles = { 'homedecor_lattice_lantern_large.png' }, - groups = { snappy = 3 }, - light_source = default.LIGHT_MAX, - sounds = default.node_sound_glass_defaults(), - }) -end - -homedecor.register("lattice_lantern_small", { - description = S("Lattice lantern (small)"), +minetest.register_node(":homedecor:chandelier_steel", { + description = S("Chandelier (steel)"), + paramtype = "light", + light_source = 12, + walkable = false, + climbable = true, + sunlight_propagates = true, tiles = { - 'homedecor_lattice_lantern_small_tb.png', - 'homedecor_lattice_lantern_small_tb.png', - 'homedecor_lattice_lantern_small_sides.png' + "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 + } + } }, - 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 } - }, - groups = { snappy = 3 }, - light_source = sm_light, - sounds = default.node_sound_glass_defaults(), - on_place = minetest.rotate_node + drawtype = "mesh", + mesh = "homedecor_chandelier.obj", + groups = {cracky=3}, + sounds = default.node_sound_stone_defaults(), }) -local brightness_tab = { - 0xffd0d0d0, - 0xffd8d8d8, - 0xffe0e0e0, - 0xffe8e8e8, - 0xffffffff, -} +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(), +}) -- table lamps and standing lamps @@ -436,13 +951,14 @@ local slamp_cbox = { local function reg_lamp(suffix, nxt, light, brightness) local wool_brighten = (light or 0) * 15 + local onoff = (suffix == "off") and "off" or "on" homedecor.register("table_lamp_"..suffix, { description = S("Table Lamp/Light"), mesh = "homedecor_table_lamp.obj", tiles = { "wool_grey.png^[colorize:#ffffff:"..wool_brighten, - { name = "homedecor_table_standing_lamp_lightbulb.png", color = brightness_tab[brightness] }, + { name = "homedecor_table_generic_light_source_"..onoff..".png", color = brightness_tab[brightness] }, { name = "homedecor_generic_wood_red.png", color = 0xffffffff }, { name = "homedecor_generic_metal.png", color = homedecor.color_black }, }, @@ -464,10 +980,9 @@ local function reg_lamp(suffix, nxt, light, brightness) on_construct = unifieddyes.on_construct, drop = { items = { - {items = {"homedecor:table_lamp_off"}, inherit_color = true }, + {items = {"homedecor:table_lamp_hi"}, inherit_color = true }, } - } - + }, }) homedecor.register("standing_lamp_"..suffix, { @@ -475,7 +990,7 @@ local function reg_lamp(suffix, nxt, light, brightness) mesh = "homedecor_standing_lamp.obj", tiles = { "wool_grey.png^[colorize:#ffffff:"..wool_brighten, - { name = "homedecor_table_standing_lamp_lightbulb.png", color = brightness_tab[brightness] }, + { name = "homedecor_table_generic_light_source_"..onoff..".png", color = brightness_tab[brightness] }, { name = "homedecor_generic_wood_red.png", color = 0xffffffff }, { name = "homedecor_generic_metal.png", color = homedecor.color_black }, }, @@ -500,7 +1015,7 @@ local function reg_lamp(suffix, nxt, light, brightness) --expand = { top="air" }, drop = { items = { - {items = {"homedecor:standing_lamp_off"}, inherit_color = true }, + {items = {"homedecor:standing_lamp_hi"}, inherit_color = true }, } } }) @@ -515,74 +1030,6 @@ reg_lamp("med", "hi", 7, 3 ) reg_lamp("hi", "max", 11, 4 ) reg_lamp("max", "off", 14, 5 ) --- "gooseneck" style desk lamps - -local dlamp_cbox = { - type = "wallmounted", - wall_side = { -0.2, -0.5, -0.15, 0.32, 0.12, 0.15 }, -} - -homedecor.register("desk_lamp", { - description = S("Desk Lamp/Light"), - 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, - groups = {snappy=3, ud_param2_colorable = 1}, - drop = "homedecor:desk_lamp", - after_place_node = function(pos, placer, itemstack, pointed_thing) - unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing) - end, - on_rotate = unifieddyes.fix_after_screwdriver_nsew -}) - --- "kitchen"/"dining room" ceiling lamp - -homedecor.register("ceiling_lamp", { - description = S("Ceiling Lamp/Light"), - mesh = "homedecor_ceiling_lamp.obj", - tiles = { - "homedecor_generic_metal_brass.png", - "homedecor_ceiling_lamp_glass.png", - "homedecor_table_standing_lamp_lightbulb.png", - { name = "homedecor_generic_plastic.png", color = 0xff442d04 }, - }, - inventory_image = "homedecor_ceiling_lamp_inv.png", - light_source = default.LIGHT_MAX, - groups = {snappy=3}, - walkable = false, - on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - minetest.set_node(pos, {name = "homedecor:ceiling_lamp_off"}) - end, -}) - -homedecor.register("ceiling_lamp_off", { - description = S("Ceiling Lamp/Light (off)"), - mesh = "homedecor_ceiling_lamp.obj", - tiles = { - "homedecor_generic_metal_brass.png", - "homedecor_ceiling_lamp_glass.png", - { "homedecor_table_standing_lamp_lightbulb.png", color = 0xffd0d0d0 }, - { name = "homedecor_generic_plastic.png", color = 0xff442d04 }, - }, - groups = {snappy=3, not_in_creative_inventory=1}, - walkable = false, - on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - minetest.set_node(pos, {name = "homedecor:ceiling_lamp"}) - end, - drop = "homedecor:ceiling_lamp" -}) - -- conversion LBM for param2 coloring homedecor.old_static_nodes = { @@ -745,98 +1192,7 @@ minetest.register_lbm({ end }) -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(), -}) -- crafting @@ -1190,11 +1546,105 @@ minetest.register_craft({ }, }) +minetest.register_craft({ + output = "homedecor:standing_lamp_hi", + recipe = { + {"homedecor:table_lamp_hi"}, + {"group:stick"}, + {"group:stick"}, + }, +}) + +unifieddyes.register_color_craft({ + output = "homedecor:standing_lamp_hi", + palette = "extended", + type = "shapeless", + neutral_node = "homedecor:standing_lamp_hi", + recipe = { + "NEUTRAL_NODE", + "MAIN_DYE" + } +}) + +minetest.register_craft({ + type = "fuel", + recipe = "homedecor:table_lamp_hi", + burntime = 10, +}) + +minetest.register_craft({ + output = "homedecor:table_lamp_hi", + recipe = { + { "wool:white", "default:torch", "wool:white"}, + { "", "group:stick", ""}, + { "", "stairs:slab_wood", "" }, + }, +}) + +minetest.register_craft({ + output = "homedecor:table_lamp_hi", + recipe = { + { "cottages:wool", "default:torch", "cottages:wool"}, + { "", "group:stick", ""}, + { "", "stairs:slab_wood", "" }, + }, +}) + +minetest.register_craft({ + output = "homedecor:table_lamp_hi", + recipe = { + { "wool:white", "default:torch", "wool:white"}, + { "", "group:stick", ""}, + { "", "moreblocks:slab_wood", "" }, + }, +}) + +minetest.register_craft({ + output = "homedecor:table_lamp_hi", + recipe = { + { "cottages:wool", "default:torch", "cottages:wool"}, + { "", "group:stick", ""}, + { "", "moreblocks:slab_wood", "" }, + }, +}) + +unifieddyes.register_color_craft({ + output = "homedecor:table_lamp_hi", + palette = "extended", + type = "shapeless", + neutral_node = "homedecor:table_lamp_hi", + recipe = { + "NEUTRAL_NODE", + "MAIN_DYE" + } +}) + -- aliases -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: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") +minetest.register_alias("chains:chandelier_steel", "homedecor:chandelier_steel") +minetest.register_alias("chains:chandelier_brass", "homedecor:chandelier_brass") +minetest.register_alias("homedecor:glowlight_half", "homedecor:glowlight_half_on") +minetest.register_alias("homedecor:glowlight_quarter", "homedecor:glowlight_quarter_on") +minetest.register_alias("homedecor:glowlight_small_cube", "homedecor:glowlight_small_cube_on") +minetest.register_alias("homedecor:plasma_lamp", "homedecor:plasma_lamp_on") +minetest.register_alias("homedecor:plasma_ball", "homedecor:plasma_ball_on") +minetest.register_alias("homedecor:wall_lantern", "homedecor:ground_lantern") +minetest.register_alias("homedecor:ground_lantern", "homedecor:ground_lantern_on") +minetest.register_alias("homedecor:hanging_lantern", "homedecor:hanging_lantern_on") +minetest.register_alias("homedecor:ceiling_lantern", "homedecor:ceiling_lantern_on") +minetest.register_alias("homedecor:lattice_lantern_large", "homedecor:lattice_lantern_large_on") +minetest.register_alias("homedecor:lattice_lantern_small", "homedecor:lattice_lantern_small_on") +minetest.register_alias("homedecor:desk_lamp", "homedecor:desk_lamp_on") +minetest.register_alias("homedecor:rope_light_on_floor", "homedecor:rope_light_on_floor_on") +minetest.register_alias("homedecor:rope_light_on_ceiling", "homedecor:rope_light_on_ceiling_on") + +if minetest.get_modpath("darkage") then + minetest.register_alias("homedecor:lattice_lantern_large_on", "darkage:lamp") + minetest.register_alias("homedecor:lattice_lantern_large_off", "darkage:lamp") +end + +minetest.log("action", "[homedecor_lightning] loaded.") diff --git a/homedecor_lighting/textures/homedecor_glowlight_base.png b/homedecor_lighting/textures/homedecor_glowlight_base.png new file mode 100644 index 00000000..1cee3bc0 Binary files /dev/null and b/homedecor_lighting/textures/homedecor_glowlight_base.png differ diff --git a/homedecor_lighting/textures/homedecor_glowlight_bottom.png b/homedecor_lighting/textures/homedecor_glowlight_bottom.png deleted file mode 100644 index 37a6b4d2..00000000 Binary files a/homedecor_lighting/textures/homedecor_glowlight_bottom.png and /dev/null differ diff --git a/homedecor_lighting/textures/homedecor_glowlight_cube_sides.png b/homedecor_lighting/textures/homedecor_glowlight_cube_sides.png deleted file mode 100644 index 31ba821b..00000000 Binary files a/homedecor_lighting/textures/homedecor_glowlight_cube_sides.png and /dev/null differ diff --git a/homedecor_lighting/textures/homedecor_glowlight_cube_sides_edges.png b/homedecor_lighting/textures/homedecor_glowlight_cube_sides_edges.png new file mode 100644 index 00000000..49f6179b Binary files /dev/null and b/homedecor_lighting/textures/homedecor_glowlight_cube_sides_edges.png differ diff --git a/homedecor_lighting/textures/homedecor_glowlight_cube_sides_overlay.png b/homedecor_lighting/textures/homedecor_glowlight_cube_sides_glare.png similarity index 100% rename from homedecor_lighting/textures/homedecor_glowlight_cube_sides_overlay.png rename to homedecor_lighting/textures/homedecor_glowlight_cube_sides_glare.png diff --git a/homedecor_lighting/textures/homedecor_glowlight_cube_tb.png b/homedecor_lighting/textures/homedecor_glowlight_cube_tb.png deleted file mode 100644 index c415202c..00000000 Binary files a/homedecor_lighting/textures/homedecor_glowlight_cube_tb.png and /dev/null differ diff --git a/homedecor_lighting/textures/homedecor_glowlight_cube_tb_edges.png b/homedecor_lighting/textures/homedecor_glowlight_cube_tb_edges.png new file mode 100644 index 00000000..f7bca653 Binary files /dev/null and b/homedecor_lighting/textures/homedecor_glowlight_cube_tb_edges.png differ diff --git a/homedecor_lighting/textures/homedecor_glowlight_cube_tb_overlay.png b/homedecor_lighting/textures/homedecor_glowlight_cube_top_glare.png similarity index 100% rename from homedecor_lighting/textures/homedecor_glowlight_cube_tb_overlay.png rename to homedecor_lighting/textures/homedecor_glowlight_cube_top_glare.png diff --git a/homedecor_lighting/textures/homedecor_glowlight_tb_edges.png b/homedecor_lighting/textures/homedecor_glowlight_tb_edges.png new file mode 100644 index 00000000..fcf524fa Binary files /dev/null and b/homedecor_lighting/textures/homedecor_glowlight_tb_edges.png differ diff --git a/homedecor_lighting/textures/homedecor_glowlight_thick_sides.png b/homedecor_lighting/textures/homedecor_glowlight_thick_sides.png deleted file mode 100644 index bae01085..00000000 Binary files a/homedecor_lighting/textures/homedecor_glowlight_thick_sides.png and /dev/null differ diff --git a/homedecor_lighting/textures/homedecor_glowlight_thick_sides_edges.png b/homedecor_lighting/textures/homedecor_glowlight_thick_sides_edges.png new file mode 100644 index 00000000..a4217506 Binary files /dev/null and b/homedecor_lighting/textures/homedecor_glowlight_thick_sides_edges.png differ diff --git a/homedecor_lighting/textures/homedecor_glowlight_top_overlay.png b/homedecor_lighting/textures/homedecor_glowlight_thick_sides_glare.png similarity index 100% rename from homedecor_lighting/textures/homedecor_glowlight_top_overlay.png rename to homedecor_lighting/textures/homedecor_glowlight_thick_sides_glare.png diff --git a/homedecor_lighting/textures/homedecor_glowlight_thick_sides_overlay.png b/homedecor_lighting/textures/homedecor_glowlight_thick_sides_overlay.png deleted file mode 100644 index 0d871d17..00000000 Binary files a/homedecor_lighting/textures/homedecor_glowlight_thick_sides_overlay.png and /dev/null differ diff --git a/homedecor_lighting/textures/homedecor_glowlight_thin_sides.png b/homedecor_lighting/textures/homedecor_glowlight_thin_sides.png deleted file mode 100644 index 51832b54..00000000 Binary files a/homedecor_lighting/textures/homedecor_glowlight_thin_sides.png and /dev/null differ diff --git a/homedecor_lighting/textures/homedecor_glowlight_thin_sides_edges.png b/homedecor_lighting/textures/homedecor_glowlight_thin_sides_edges.png new file mode 100644 index 00000000..6110d677 Binary files /dev/null and b/homedecor_lighting/textures/homedecor_glowlight_thin_sides_edges.png differ diff --git a/homedecor_lighting/textures/homedecor_glowlight_thin_sides_glare.png b/homedecor_lighting/textures/homedecor_glowlight_thin_sides_glare.png new file mode 100644 index 00000000..fd92157b Binary files /dev/null and b/homedecor_lighting/textures/homedecor_glowlight_thin_sides_glare.png differ diff --git a/homedecor_lighting/textures/homedecor_glowlight_thin_sides_overlay.png b/homedecor_lighting/textures/homedecor_glowlight_thin_sides_overlay.png deleted file mode 100644 index f9335ef5..00000000 Binary files a/homedecor_lighting/textures/homedecor_glowlight_thin_sides_overlay.png and /dev/null differ diff --git a/homedecor_lighting/textures/homedecor_glowlight_top.png b/homedecor_lighting/textures/homedecor_glowlight_top.png deleted file mode 100644 index 70518e79..00000000 Binary files a/homedecor_lighting/textures/homedecor_glowlight_top.png and /dev/null differ diff --git a/homedecor_lighting/textures/homedecor_glowlight_top_glare.png b/homedecor_lighting/textures/homedecor_glowlight_top_glare.png new file mode 100644 index 00000000..5fbf8910 Binary files /dev/null and b/homedecor_lighting/textures/homedecor_glowlight_top_glare.png differ diff --git a/homedecor_lighting/textures/homedecor_lattice_lantern_large.png b/homedecor_lighting/textures/homedecor_lattice_lantern_large.png deleted file mode 100644 index ac322300..00000000 Binary files a/homedecor_lighting/textures/homedecor_lattice_lantern_large.png and /dev/null differ diff --git a/homedecor_lighting/textures/homedecor_lattice_lantern_large_light.png b/homedecor_lighting/textures/homedecor_lattice_lantern_large_light.png new file mode 100644 index 00000000..55bc341e Binary files /dev/null and b/homedecor_lighting/textures/homedecor_lattice_lantern_large_light.png differ diff --git a/homedecor_lighting/textures/homedecor_lattice_lantern_large_overlay.png b/homedecor_lighting/textures/homedecor_lattice_lantern_large_overlay.png new file mode 100644 index 00000000..e6bbae5e Binary files /dev/null and b/homedecor_lighting/textures/homedecor_lattice_lantern_large_overlay.png differ diff --git a/homedecor_lighting/textures/homedecor_lattice_lantern_small_sides.png b/homedecor_lighting/textures/homedecor_lattice_lantern_small_sides.png deleted file mode 100644 index 48c517f2..00000000 Binary files a/homedecor_lighting/textures/homedecor_lattice_lantern_small_sides.png and /dev/null differ diff --git a/homedecor_lighting/textures/homedecor_lattice_lantern_small_sides_light.png b/homedecor_lighting/textures/homedecor_lattice_lantern_small_sides_light.png new file mode 100644 index 00000000..e0b37bee Binary files /dev/null and b/homedecor_lighting/textures/homedecor_lattice_lantern_small_sides_light.png differ diff --git a/homedecor_lighting/textures/homedecor_lattice_lantern_small_sides_overlay.png b/homedecor_lighting/textures/homedecor_lattice_lantern_small_sides_overlay.png new file mode 100644 index 00000000..7122b6b9 Binary files /dev/null and b/homedecor_lighting/textures/homedecor_lattice_lantern_small_sides_overlay.png differ diff --git a/homedecor_lighting/textures/homedecor_lattice_lantern_small_tb.png b/homedecor_lighting/textures/homedecor_lattice_lantern_small_tb.png deleted file mode 100644 index eb28a0d5..00000000 Binary files a/homedecor_lighting/textures/homedecor_lattice_lantern_small_tb.png and /dev/null differ diff --git a/homedecor_lighting/textures/homedecor_lattice_lantern_small_tb_light.png b/homedecor_lighting/textures/homedecor_lattice_lantern_small_tb_light.png new file mode 100644 index 00000000..4d7c3257 Binary files /dev/null and b/homedecor_lighting/textures/homedecor_lattice_lantern_small_tb_light.png differ diff --git a/homedecor_lighting/textures/homedecor_lattice_lantern_small_tb_overlay.png b/homedecor_lighting/textures/homedecor_lattice_lantern_small_tb_overlay.png new file mode 100644 index 00000000..f22874d1 Binary files /dev/null and b/homedecor_lighting/textures/homedecor_lattice_lantern_small_tb_overlay.png differ diff --git a/homedecor_lighting/textures/homedecor_plasma_lamp_off.png b/homedecor_lighting/textures/homedecor_plasma_lamp_off.png new file mode 100644 index 00000000..82dbcba7 Binary files /dev/null and b/homedecor_lighting/textures/homedecor_plasma_lamp_off.png differ diff --git a/homedecor_lighting/textures/homedecor_rope_light_on_ceiling.png b/homedecor_lighting/textures/homedecor_rope_light_on_ceiling.png new file mode 100644 index 00000000..78e6d4bc Binary files /dev/null and b/homedecor_lighting/textures/homedecor_rope_light_on_ceiling.png differ diff --git a/homedecor_lighting/textures/homedecor_rope_light_on_floor.png b/homedecor_lighting/textures/homedecor_rope_light_on_floor.png new file mode 100644 index 00000000..30bd14c0 Binary files /dev/null and b/homedecor_lighting/textures/homedecor_rope_light_on_floor.png differ diff --git a/homedecor_lighting/textures/homedecor_table_generic_light_source_off.png b/homedecor_lighting/textures/homedecor_table_generic_light_source_off.png new file mode 100644 index 00000000..e18bb2c9 Binary files /dev/null and b/homedecor_lighting/textures/homedecor_table_generic_light_source_off.png differ diff --git a/homedecor_lighting/textures/homedecor_table_standing_lamp_lightbulb.png b/homedecor_lighting/textures/homedecor_table_generic_light_source_on.png similarity index 100% rename from homedecor_lighting/textures/homedecor_table_standing_lamp_lightbulb.png rename to homedecor_lighting/textures/homedecor_table_generic_light_source_on.png diff --git a/homedecor_misc/init.lua b/homedecor_misc/init.lua index afeee27e..95135aef 100644 --- a/homedecor_misc/init.lua +++ b/homedecor_misc/init.lua @@ -999,3 +999,58 @@ unifieddyes.register_color_craft({ "MAIN_DYE", } }) + +-- Japanese-style wood/paper wall pieces and door + +local jp_cbox = { + type = "fixed", + fixed = {-0.5, -0.5, 0, 0.5, 0.5, 0.0625}, +} + +minetest.register_node(":homedecor:japanese_wall_top", { + description = S("Japanese wall (top)"), + drawtype = "mesh", + mesh = "homedecor_wall_japanese_top.obj", + tiles = { + homedecor.lux_wood, + "homedecor_japanese_paper.png" + }, + paramtype = "light", + paramtype2 = "facedir", + groups = {snappy=3}, + selection_box = jp_cbox, + collision_box = jp_cbox, + sounds = default.node_sound_wood_defaults(), +}) + +minetest.register_node(":homedecor:japanese_wall_middle", { + description = S("Japanese wall"), + drawtype = "mesh", + mesh = "homedecor_wall_japanese_middle.obj", + tiles = { + homedecor.lux_wood, + "homedecor_japanese_paper.png" + }, + paramtype = "light", + paramtype2 = "facedir", + groups = {snappy=3}, + selection_box = jp_cbox, + collision_box = jp_cbox, + sounds = default.node_sound_wood_defaults(), +}) + +minetest.register_node(":homedecor:japanese_wall_bottom", { + description = S("Japanese wall (bottom)"), + drawtype = "mesh", + mesh = "homedecor_wall_japanese_bottom.obj", + tiles = { + homedecor.lux_wood, + "homedecor_japanese_paper.png" + }, + paramtype = "light", + paramtype2 = "facedir", + groups = {snappy=3}, + selection_box = jp_cbox, + collision_box = jp_cbox, + sounds = default.node_sound_wood_defaults(), +})