diff --git a/craft_ingredients/init.lua b/craft_ingredients/init.lua index e359aea..dec1b46 100644 --- a/craft_ingredients/init.lua +++ b/craft_ingredients/init.lua @@ -152,6 +152,18 @@ minetest.register_craftitem(":multidecor:four_lampshades_set", inventory_image = "multidecor_four_lampshades_set.png" }) +minetest.register_craftitem(":multidecor:digital_dial", +{ + description = "Digital Dial", + inventory_image = "multidecor_digital_dial.png" +}) + +minetest.register_craftitem(":multidecor:brass_ingot", +{ + description = "Brass Ingot", + inventory_image = "multidecor_brass_ingot.png" +}) + minetest.register_craft( { type = "shapeless", @@ -255,6 +267,28 @@ minetest.register_craft({ recipe = {"multidecor:lampshade", "multidecor:lampshade", "multidecor:lampshade", "multidecor:lampshade"} }) +minetest.register_craft({ + type = "shapeless", + output = "multidecor:brass_ingot", + recipe = {"default:copper_ingot", "multidecor:zinc_ingot"} +}) + +minetest.register_craft({ + type = "shapeless", + output = "multidecor:brass_ingot", + recipe = {"default:copper_ingot", "default:tin_ingot"} +}) + +minetest.register_craft({ + output = "multidecor:digital_dial", + recipe = { + {"multidecor:plastic_sheet", "dye:white", "dye:black"}, + {"multidecor:steel_scissors", "", ""}, + {"", "", ""} + }, + replacements = {{"multidecor:steel_scissors", "multidecor:steel_scissors"}} +}) + minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv) local contains_saw = false local contains_steel_scissors = false diff --git a/craft_ingredients/ores.lua b/craft_ingredients/ores.lua index 5825d33..2fa7e08 100644 --- a/craft_ingredients/ores.lua +++ b/craft_ingredients/ores.lua @@ -13,7 +13,7 @@ minetest.register_node(":multidecor:wolfram_ore", { } } }, - groups = {cracky=3.5}, + groups = {cracky=2.5}, sounds = default.node_sound_stone_defaults() }) @@ -32,7 +32,7 @@ minetest.register_node(":multidecor:desert_wolfram_ore", { } } }, - groups = {cracky=3.5}, + groups = {cracky=2.5}, sounds = default.node_sound_stone_defaults() }) @@ -76,3 +76,82 @@ minetest.register_craft({ recipe = "multidecor:wolfram_ore", cooktime = 8 }) + +minetest.register_node(":multidecor:zinc_ore", { + description = "Zinc Ore", + tiles = {"default_stone.png^multidecor_zinc_mineral.png"}, + is_ground_content = true, + paramtype = "light", + light_source = 6, + drop = { + max_items = 5, + items = { + { + rarity = 1000, + items = {"multidecor:zinc_fragment"} + } + } + }, + groups = {cracky=3.5}, + sounds = default.node_sound_stone_defaults() +}) + +minetest.register_node(":multidecor:desert_zinc_ore", { + description = "Desert Zinc Ore", + tiles = {"default_desert_stone.png^multidecor_zinc_mineral.png"}, + is_ground_content = true, + paramtype = "light", + light_source = 6, + drop = { + max_items = 5, + items = { + { + rarity = 1000, + items = {"multidecor:zinc_lump"} + } + } + }, + groups = {cracky=3.5}, + sounds = default.node_sound_stone_defaults() +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "multidecor:zinc_ore", + wherein = "default:stone", + clust_scarcity = 400, + clust_num_ores = 5, + clust_size = 3, + height_min = -31000, + height_max = -125 +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "multidecor:desert_zinc_ore", + wherein = "default:stone", + clust_scarcity = 400, + clust_num_ores = 5, + clust_size = 3, + height_min = -31000, + height_max = -125 +}) + +minetest.register_craftitem(":multidecor:zinc_fragment", +{ + description = "Zinc Fragment", + inventory_image = "multidecor_zinc_fragment.png" +}) + +minetest.register_craftitem(":multidecor:zinc_ingot", +{ + description = "Zinc Ingot", + inventory_image = "multidecor_zinc_ingot.png" +}) + +minetest.register_craft({ + type = "cooking", + output = "multidecor:zinc_ingot", + recipe = "multidecor:zinc_fragment", + cooktime = 5 +}) diff --git a/craft_ingredients/textures/multidecor_brass_ingot.png b/craft_ingredients/textures/multidecor_brass_ingot.png new file mode 100644 index 0000000..432f200 Binary files /dev/null and b/craft_ingredients/textures/multidecor_brass_ingot.png differ diff --git a/craft_ingredients/textures/multidecor_digital_dial.png b/craft_ingredients/textures/multidecor_digital_dial.png new file mode 100644 index 0000000..399d9d3 Binary files /dev/null and b/craft_ingredients/textures/multidecor_digital_dial.png differ diff --git a/craft_ingredients/textures/multidecor_zinc_fragment.png b/craft_ingredients/textures/multidecor_zinc_fragment.png new file mode 100644 index 0000000..869eeea Binary files /dev/null and b/craft_ingredients/textures/multidecor_zinc_fragment.png differ diff --git a/craft_ingredients/textures/multidecor_zinc_ingot.png b/craft_ingredients/textures/multidecor_zinc_ingot.png new file mode 100644 index 0000000..b0cf196 Binary files /dev/null and b/craft_ingredients/textures/multidecor_zinc_ingot.png differ diff --git a/craft_ingredients/textures/multidecor_zinc_mineral.png b/craft_ingredients/textures/multidecor_zinc_mineral.png new file mode 100644 index 0000000..62937ca Binary files /dev/null and b/craft_ingredients/textures/multidecor_zinc_mineral.png differ diff --git a/decor_api/connecting.lua b/decor_api/connecting.lua index 039f163..4e9bd5e 100644 --- a/decor_api/connecting.lua +++ b/decor_api/connecting.lua @@ -78,6 +78,7 @@ function connecting.replace_node_to(pos, disconnect) end minetest.debug("target_node: " .. target_node) target_node = target_node ~= "" and "_" .. target_node or "" + if not disconnect and target_node == "" then return end @@ -103,18 +104,13 @@ function connecting.directional_replace_node_to(pos, dir, side, disconnect) local dir_rot = math.deg(vector.dir_to_rotation(dir).y) local dir_rot2 = math.deg(vector.dir_to_rotation(helpers.get_dir(pos)).y) - minetest.debug("side: " .. dump(side)) - minetest.debug("dir_rot: " .. dir_rot) - minetest.debug("dir_rot2: " .. dir_rot2) local is_left_corner = add_props.connect_parts.left_side == def.mesh and side == "right" and dir_rot-90 == dir_rot2 local is_right_corner = add_props.connect_parts.right_side == def.mesh and side == "left" and dir_rot+90 == dir_rot2 if is_left_corner then - --minetest.debug("left corner") right_dir = dir elseif is_right_corner then - --minetest.debug("right corner") left_dir = dir end diff --git a/decor_api/lighting.lua b/decor_api/lighting.lua index 7a391b7..a872048 100644 --- a/decor_api/lighting.lua +++ b/decor_api/lighting.lua @@ -35,7 +35,8 @@ function register.register_light(name, base_def, add_def, craft_def) end local sound_off - if def.add_properties then + local are_props = def.add_properties and def.add_properties.swap_light + if are_props then sound_off = def.add_properties.swap_light.sound_off or "multidecor_light_off" def.add_properties.swap_light.sound = def.add_properties.swap_light.sound_on or "multidecor_light_on" def.add_properties.swap_light.sound_on = nil @@ -44,7 +45,7 @@ function register.register_light(name, base_def, add_def, craft_def) register.register_furniture_unit(name, def, craft_def) - if def.add_properties then + if are_props then local def2 = table.copy(def) local swap_light_name = def2.add_properties.swap_light.name def2.light_source = def2.add_properties.swap_light.light_level or 8 diff --git a/modern/bedroom.lua b/modern/bedroom.lua index a2f4e05..e2c6336 100644 --- a/modern/bedroom.lua +++ b/modern/bedroom.lua @@ -87,6 +87,7 @@ register.register_table("dresser_with_mirror", { visual_scale = 0.5, mesh = "multidecor_dresser_with_mirror.b3d", tiles = {"multidecor_aspen_wood.png", "multidecor_gloss.png"}, + inventory_image = "multidecor_dresser_with_mirror_inv.png", use_texture_alpha = "blend", bounding_boxes = { {-0.5, -0.5, -0.5, 1.5, 0.5, 0.5} diff --git a/modern/lamps.lua b/modern/lamps.lua index 1f07f72..fdd0ea9 100644 --- a/modern/lamps.lua +++ b/modern/lamps.lua @@ -193,3 +193,34 @@ register.register_light("metal_chandelier_with_plastic_plafonds_off", { {"multidecor:metal_bar", "", ""} } }) + +register.register_light("brass_candlestick", { + style = "modern", + material = "metal", + description = "Brass Candlestick", + visual_scale = 0.5, + use_texture_alpha = "blend", + light_source = 10, + mesh = "multidecor_brass_candlestick.b3d", + tiles = { + "multidecor_brass_material.png", + "multidecor_candle.png", + {name="multidecor_flame_anim.png", animation={ + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 3.0 + }} + }, + bounding_boxes = { + {-0.25, -0.5, -0.25, 0.25, -0.4, 0.25}, + {-0.1, -0.4, -0.1, 0.1, 0.125, 0.1} + }, +}, +{ + recipe = { + {"multidecor:steel_sheet", "multidecor:steel_sheet", "multidecor:brass_ingot"}, + {"", "", ""}, + {"", "", ""} + } +}) diff --git a/modern/living_room.lua b/modern/living_room.lua index 2aa6b76..b2aaa1b 100644 --- a/modern/living_room.lua +++ b/modern/living_room.lua @@ -15,3 +15,74 @@ register.register_furniture_unit("modern_floor_clock", { }, bounding_boxes = {{-0.4, -0.5, -0.3, 0.4, 2, 0.4}} }) + + +register.register_furniture_unit("book", { + type = "decoration", + style = "modern", + material = "wood", + visual_scale = 0.5, + description = "Book", + mesh = "multidecor_book.b3d", + tiles = { + "multidecor_book_envelope.png^[multiply:blue^multidecor_book_pattern.png", + "multidecor_book.png" + }, + bounding_boxes = {{-0.2, -0.5, -0.3, 0.2, -0.35, 0.3}} +}, +{ + recipe = { + {"default:paper", "default:paper", "dye:blue"}, + {"default:paper", "default:paper", "default:paper"}, + {"default:paper", "default:paper", "default:paper"} + } +}) + +register.register_furniture_unit("books_stack", { + type = "decoration", + style = "modern", + material = "wood", + visual_scale = 0.5, + description = "Books Stack", + mesh = "multidecor_books_stack.b3d", + tiles = { + "multidecor_book_envelope.png^[multiply:green^multidecor_book_pattern.png", + "multidecor_book.png", + "multidecor_book_envelope.png^[multiply:blueviolet^multidecor_book_pattern.png", + "multidecor_book_envelope.png^[multiply:red", + "multidecor_book_envelope.png^[multiply:darkorange^multidecor_book_pattern2.png", + }, + bounding_boxes = {{-0.2, -0.5, -0.3, 0.2, -0.1, 0.3}} +}, +{ + type = "shapeless", + recipe = { + "multidecor:book", "multidecor:book", + "multidecor:book", "multidecor:book" + } +}) + +register.register_furniture_unit("alarm_clock", { + type = "decoration", + style = "modern", + material = "plastic", + visual_scale = 0.5, + description = "Alarm Clock", + mesh = "multidecor_alarm_clock.b3d", + tiles = { + "multidecor_plastic_material.png^[multiply:green", + "multidecor_metal_material.png", + "multidecor_digital_dial.png", + "multidecor_glass_material.png" + }, + use_texture_alpha = "blend", + bounding_boxes = {{-0.25, -0.5, -0.175, 0.25, 0.1, 0.175}} +}, +{ + recipe = { + {"multidecor:steel_sheet", "multidecor:steel_sheet", "dye:green"}, + {"multidecor:plastic_sheet", "multidecor:digital_dial", "multidecor:plastic_sheet"}, + {"", "multidecor:plastic_sheet", ""} + } +}) + diff --git a/modern/models/multidecor_alarm_clock.b3d b/modern/models/multidecor_alarm_clock.b3d new file mode 100644 index 0000000..7b959b1 Binary files /dev/null and b/modern/models/multidecor_alarm_clock.b3d differ diff --git a/modern/models/multidecor_alarm_clock.blend b/modern/models/multidecor_alarm_clock.blend new file mode 100644 index 0000000..bd736c2 Binary files /dev/null and b/modern/models/multidecor_alarm_clock.blend differ diff --git a/modern/models/multidecor_alarm_clock.blend1 b/modern/models/multidecor_alarm_clock.blend1 new file mode 100644 index 0000000..4414ea5 Binary files /dev/null and b/modern/models/multidecor_alarm_clock.blend1 differ diff --git a/modern/models/multidecor_book.b3d b/modern/models/multidecor_book.b3d new file mode 100644 index 0000000..875fdd2 Binary files /dev/null and b/modern/models/multidecor_book.b3d differ diff --git a/modern/models/multidecor_book.blend b/modern/models/multidecor_book.blend new file mode 100644 index 0000000..d0aea46 Binary files /dev/null and b/modern/models/multidecor_book.blend differ diff --git a/modern/models/multidecor_book.blend1 b/modern/models/multidecor_book.blend1 new file mode 100644 index 0000000..32416ec Binary files /dev/null and b/modern/models/multidecor_book.blend1 differ diff --git a/modern/models/multidecor_books_stack.b3d b/modern/models/multidecor_books_stack.b3d new file mode 100644 index 0000000..addd2c5 Binary files /dev/null and b/modern/models/multidecor_books_stack.b3d differ diff --git a/modern/models/multidecor_books_stack.blend b/modern/models/multidecor_books_stack.blend new file mode 100644 index 0000000..f865251 Binary files /dev/null and b/modern/models/multidecor_books_stack.blend differ diff --git a/modern/models/multidecor_books_stack.blend1 b/modern/models/multidecor_books_stack.blend1 new file mode 100644 index 0000000..3413290 Binary files /dev/null and b/modern/models/multidecor_books_stack.blend1 differ diff --git a/modern/models/multidecor_brass_candlestick.b3d b/modern/models/multidecor_brass_candlestick.b3d new file mode 100644 index 0000000..0b02ac6 Binary files /dev/null and b/modern/models/multidecor_brass_candlestick.b3d differ diff --git a/modern/models/multidecor_brass_candlestick.blend b/modern/models/multidecor_brass_candlestick.blend new file mode 100644 index 0000000..3c4b101 Binary files /dev/null and b/modern/models/multidecor_brass_candlestick.blend differ diff --git a/modern/models/multidecor_brass_candlestick.blend1 b/modern/models/multidecor_brass_candlestick.blend1 new file mode 100644 index 0000000..9f887e7 Binary files /dev/null and b/modern/models/multidecor_brass_candlestick.blend1 differ diff --git a/modern/models/multidecor_wall_shelf_with_books.b3d b/modern/models/multidecor_wall_shelf_with_books.b3d index 788ffa6..9d91048 100644 Binary files a/modern/models/multidecor_wall_shelf_with_books.b3d and b/modern/models/multidecor_wall_shelf_with_books.b3d differ diff --git a/modern/models/multidecor_wall_shelf_with_books.blend b/modern/models/multidecor_wall_shelf_with_books.blend index 1905f73..416f85a 100644 Binary files a/modern/models/multidecor_wall_shelf_with_books.blend and b/modern/models/multidecor_wall_shelf_with_books.blend differ diff --git a/modern/models/multidecor_wall_shelf_with_books.blend1 b/modern/models/multidecor_wall_shelf_with_books.blend1 index 437929f..390c513 100644 Binary files a/modern/models/multidecor_wall_shelf_with_books.blend1 and b/modern/models/multidecor_wall_shelf_with_books.blend1 differ diff --git a/modern/paintings.lua b/modern/paintings.lua index 7ca0cf1..29f0ed5 100644 --- a/modern/paintings.lua +++ b/modern/paintings.lua @@ -9,29 +9,73 @@ local frame_types = { local materials = {"wood", "plastic"} +local dyes = { + "black", + "blue", + "brown", + "cyan", + "dark_green", + "dark_grey", + "green", + "grey", + "magenta", + "orange", + "pink", + "red", + "violet", + "white", + "yellow" +} + local bbox = {-0.5, -0.5, 0.35, 0.5, 0.5, 0.5} local images = { --{, , , } - {"alps", 1, 1, 1}, - {"cactus_valley", 1, 2, 1}, - {"cefeus", 1, 2, 1}, - {"chamomile", 4, 1, 1}, - {"dark_forest", 2, 1, 1}, - {"elk", 1, 2, 1}, - {"forest", 4, 1, 1}, - {"jupiter_and_saturn", 2, 2, 2}, - {"minetest_castle", 5, 1, 1}, - {"minetest_logo", 1, 2, 1}, - {"prairie", 1, 1, 1}, - {"rose", 4, 1, 1}, - {"ship_in_lava", 4, 1, 2}, - {"sky", 3, 2, 1}, - {"sunset_in_sea", 6, 1, 1}, - {"supernova", 3, 1, 2}, - {"tropic", 2, 2, 1} + {"alps", 1, 1, 1, {4, 5, 8, 14, 6}}, + {"cactus_valley", 1, 2, 1, {3, 7, 14, 15, 11}}, + {"cefeus", 1, 2, 1, {1, 14, 8, 13}}, + {"chamomile", 4, 1, 1, {7, 14, 15, 10}}, + {"dark_forest", 2, 1, 1, {1, 2, 13, 5, 4}}, + {"elk", 1, 2, 1, {15, 7, 3, 14}}, + {"forest", 4, 1, 1, {15, 3, 7, 14}}, + {"jupiter_and_saturn", 2, 2, 2, {1, 3, 12, 11, 15}}, + {"minetest_castle", 5, 1, 1, {4, 14, 8, 3, 2}}, + {"minetest_logo", 1, 2, 1, {2, 5, 14, 15, 4}}, + {"prairie", 1, 1, 1, {15, 4, 14, 2}}, + {"rose", 4, 1, 1, {12, 5, 11, 7}}, + {"ship_in_lava", 4, 1, 2, {1, 12, 10, 15, 2}}, + {"sky", 3, 2, 1, {4, 14, 12, 15, 7}}, + {"sunset_in_sea", 6, 1, 1, {14, 15, 2, 13}}, + {"supernova", 3, 1, 2, {1, 11, 14, 13}}, + {"tropic", 2, 2, 1, {4, 2, 7, 5, 14}} } +local function painting_craft_recipe(inds) + local recipe = { + {"", "", ""}, + {"", "multidecor:painting_frame", ""}, + {"", "", ""} + } + + local c = 0 + local n = 0 + for i, dye_i in ipairs(inds) do + n = n + 1 + if i == 5 then + n = n+1 + c = c+1 + end + + if c == 3 then + c = 0 + end + + c = c + 1 + recipe[math.ceil(n/3)][c] = "dye:" .. dyes[dye_i] + end + + return recipe +end for _, img in ipairs(images) do local img_bbox = table.copy(bbox) @@ -68,5 +112,24 @@ for _, img in ipairs(images) do mesh = "multidecor_" .. mesh .. ".b3d", tiles = {base_tile, "multidecor_image_" .. img[1] .. ".png"}, bounding_boxes = {img_bbox} + }, + { + recipe = painting_craft_recipe(img[5]) }) end + + +minetest.register_craftitem(":multidecor:painting_frame", { + description = "Painting Frame", + inventory_image = "multidecor_painting_frame.png" +}) + +minetest.register_craft({ + output = "multidecor:painting_frame", + recipe = { + {"default:paper", "multidecor:plank", "multidecor:saw"}, + {"", "", ""}, + {"", "", ""} + }, + replacements = {{"multidecor:saw", "multidecor:saw"}} +}) diff --git a/modern/shelves.lua b/modern/shelves.lua index 34cea27..2444de0 100644 --- a/modern/shelves.lua +++ b/modern/shelves.lua @@ -86,9 +86,9 @@ for _, wood_n in ipairs({"", "jungle", "pine", "aspen"}) do {-0.5, 0, 0.15, -0.4, -0.5, 0.4}, {0.4, 0, 0.15, 0.5, -0.5, 0.4} } - }--[[, + }, { type = "shapeless", - recipe = {"multidecor:" .. wood_n .. "plank", "multidecor:" .. wood_n .. "plank"} - }]]) + recipe = {"multidecor:modern_wooden_" .. wood_n .. "wall_shelf", "multidecor:books_stack"} + }) end diff --git a/modern/textures/multidecor_brass_material.png b/modern/textures/multidecor_brass_material.png new file mode 100644 index 0000000..3de4e76 Binary files /dev/null and b/modern/textures/multidecor_brass_material.png differ diff --git a/modern/textures/multidecor_candle.png b/modern/textures/multidecor_candle.png new file mode 100644 index 0000000..e63f1d1 Binary files /dev/null and b/modern/textures/multidecor_candle.png differ diff --git a/modern/textures/multidecor_dresser_with_mirror_inv.png b/modern/textures/multidecor_dresser_with_mirror_inv.png new file mode 100644 index 0000000..00a9468 Binary files /dev/null and b/modern/textures/multidecor_dresser_with_mirror_inv.png differ diff --git a/modern/textures/multidecor_flame_anim.png b/modern/textures/multidecor_flame_anim.png new file mode 100644 index 0000000..18658c2 Binary files /dev/null and b/modern/textures/multidecor_flame_anim.png differ diff --git a/modern/textures/multidecor_painting_frame.png b/modern/textures/multidecor_painting_frame.png new file mode 100644 index 0000000..df1b974 Binary files /dev/null and b/modern/textures/multidecor_painting_frame.png differ