diff --git a/homedecor/furniture.lua b/homedecor/furniture.lua index deb9a72b..51d772a4 100644 --- a/homedecor/furniture.lua +++ b/homedecor/furniture.lua @@ -37,31 +37,8 @@ for _, i in ipairs(table_colors) do }) end -minetest.register_node("homedecor:chair", { - description = S("Chair"), - tiles = { "forniture_wood.png" }, - drawtype = "nodebox", - paramtype = "light", - paramtype2 = "facedir", - node_box = { - type = "fixed", - fixed = { - { -0.3, -0.5, 0.20, -0.2, 0.5, 0.30 }, - { 0.2, -0.5, 0.20, 0.3, 0.5, 0.30 }, - { -0.3, -0.5, -0.30, -0.2, -0.1, -0.20 }, - { 0.2, -0.5, -0.30, 0.3, -0.1, -0.20 }, - { -0.3, -0.1, -0.30, 0.3, 0.0, 0.20 }, - { -0.2, 0.1, 0.25, 0.2, 0.4, 0.26 }, - }, - }, - selection_box = { - type = "fixed", - fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}, - }, - groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, -}) - local chaircolors = { + { "", "plain" }, { "black", "Black" }, { "red", "Red" }, { "pink", "Pink" }, @@ -71,55 +48,87 @@ local chaircolors = { } for i in ipairs(chaircolors) do - local color = chaircolors[i][1] + + local color = "_"..chaircolors[i][1] + local color2 = chaircolors[i][1] local name = S(chaircolors[i][2]) - minetest.register_node("homedecor:armchair_"..color, { - description = S("Armchair (%s)"):format(name), - tiles = { - "forniture_armchair_top_"..color..".png", - "forniture_armchair_top_"..color..".png", - "forniture_armchair_lat1_"..color..".png", - "forniture_armchair_lat1_"..color..".png", - "forniture_armchair_lat2_"..color..".png", - "forniture_armchair_lat2_"..color..".png", - }, - drawtype = "nodebox", - sunlight_propagates = true, - paramtype = "light", - paramtype2 = "facedir", - node_box = { - type = "fixed", - fixed = { - { -0.50, -0.50, -0.45, -0.30, 0.05, 0.30 }, - { -0.45, -0.50, -0.50, -0.35, 0.05, -0.45 }, - { -0.45, 0.05, -0.45, -0.35, 0.10, 0.15 }, - { 0.30, -0.50, -0.45, 0.50, 0.05, 0.30 }, - { 0.35, -0.50, -0.50, 0.45, 0.05, -0.45 }, - { 0.35, 0.05, -0.45, 0.45, 0.10, 0.15 }, - { -0.50, -0.50, 0.30, 0.50, 0.45, 0.50 }, - { -0.45, 0.45, 0.35, 0.45, 0.50, 0.45 }, - { -0.30, -0.45, -0.35, 0.30, -0.10, 0.30 }, - { -0.30, -0.45, -0.40, 0.30, -0.15, -0.35 }, - { -0.50, 0.05, 0.15, -0.30, 0.45, 0.30 }, - { -0.45, 0.10, 0.10, -0.35, 0.45, 0.15 }, - { -0.45, 0.45, 0.15, -0.35, 0.50, 0.35 }, - { 0.30, 0.05, 0.15, 0.50, 0.45, 0.30 }, - { 0.35, 0.10, 0.10, 0.45, 0.45, 0.15 }, - { 0.35, 0.45, 0.15, 0.45, 0.50, 0.35 }, + + if chaircolors[i][1] == "" then + color = "" + end + + minetest.register_node("homedecor:chair"..color, { + description = S("Kitchen chair (%s)"):format(name), + tiles = { + "forniture_kitchen_chair_top"..color..".png", + "forniture_wood.png", + "forniture_kitchen_chair_sides"..color..".png", + "forniture_kitchen_chair_sides"..color..".png^[transformFX", + "forniture_kitchen_chair_back"..color..".png", + "forniture_kitchen_chair_front"..color..".png", + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + node_box = { + type = "fixed", + fixed = { + {-0.3125, -0.5, 0.1875, -0.1875, 0.5, 0.3125}, + {0.1875, -0.5, 0.1875, 0.3125, 0.5, 0.3125}, + {-0.3125, -0.5, -0.3125, -0.1875, 0, -0.1875}, + {0.1875, -0.5, -0.3125, 0.3125, 0, -0.1875}, + {-0.3125, -0.125, -0.3125, 0.3125, 0, 0.3125}, + {-0.25, 0.0625, 0.25, 0.25, 0.4375, 0.25}, + }, }, - }, - groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}, + }, + groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, }) - minetest.register_craft({ - output = "homedecor:armchair_"..color.." 2", - recipe = { - { "wool:"..color,""}, - { "group:wood","group:wood" }, - { "wool:"..color,"wool:"..color }, - }, - }) + if color ~= "" then + minetest.register_node("homedecor:armchair"..color, { + description = S("Armchair (%s)"):format(name), + tiles = { "forniture_armchair_top"..color..".png" }, + drawtype = "nodebox", + sunlight_propagates = true, + paramtype = "light", + paramtype2 = "facedir", + node_box = { + type = "fixed", + fixed = { + { -0.50, -0.50, -0.45, -0.30, 0.05, 0.30 }, + { -0.45, -0.50, -0.50, -0.35, 0.05, -0.45 }, + { -0.45, 0.05, -0.45, -0.35, 0.10, 0.15 }, + { 0.30, -0.50, -0.45, 0.50, 0.05, 0.30 }, + { 0.35, -0.50, -0.50, 0.45, 0.05, -0.45 }, + { 0.35, 0.05, -0.45, 0.45, 0.10, 0.15 }, + { -0.50, -0.50, 0.30, 0.50, 0.45, 0.50 }, + { -0.45, 0.45, 0.35, 0.45, 0.50, 0.45 }, + { -0.30, -0.45, -0.35, 0.30, -0.10, 0.30 }, + { -0.30, -0.45, -0.40, 0.30, -0.15, -0.35 }, + { -0.50, 0.05, 0.15, -0.30, 0.45, 0.30 }, + { -0.45, 0.10, 0.10, -0.35, 0.45, 0.15 }, + { -0.45, 0.45, 0.15, -0.35, 0.50, 0.35 }, + { 0.30, 0.05, 0.15, 0.50, 0.45, 0.30 }, + { 0.35, 0.10, 0.10, 0.45, 0.45, 0.15 }, + { 0.35, 0.45, 0.15, 0.45, 0.50, 0.35 }, + }, + }, + groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}, + }) + minetest.register_craft({ + output = "homedecor:armchair"..color.." 2", + recipe = { + { "wool:"..color2,""}, + { "group:wood","group:wood" }, + { "wool:"..color2,"wool:"..color2 }, + }, + }) + end end local repl = { off="low", low="med", med="hi", hi="max", max="off", } diff --git a/homedecor/textures/forniture_kitchen_chair_back.png b/homedecor/textures/forniture_kitchen_chair_back.png new file mode 100644 index 00000000..7e44cea5 Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_back.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_back_black.png b/homedecor/textures/forniture_kitchen_chair_back_black.png new file mode 100644 index 00000000..178c71b5 Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_back_black.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_back_blue.png b/homedecor/textures/forniture_kitchen_chair_back_blue.png new file mode 100644 index 00000000..5cbc7589 Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_back_blue.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_back_dark_green.png b/homedecor/textures/forniture_kitchen_chair_back_dark_green.png new file mode 100644 index 00000000..7094c988 Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_back_dark_green.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_back_pink.png b/homedecor/textures/forniture_kitchen_chair_back_pink.png new file mode 100644 index 00000000..58ed0bfb Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_back_pink.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_back_red.png b/homedecor/textures/forniture_kitchen_chair_back_red.png new file mode 100644 index 00000000..7fb0a354 Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_back_red.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_back_violet.png b/homedecor/textures/forniture_kitchen_chair_back_violet.png new file mode 100644 index 00000000..0f280507 Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_back_violet.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_front.png b/homedecor/textures/forniture_kitchen_chair_front.png new file mode 100644 index 00000000..7e44cea5 Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_front.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_front_black.png b/homedecor/textures/forniture_kitchen_chair_front_black.png new file mode 100644 index 00000000..74f76a24 Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_front_black.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_front_blue.png b/homedecor/textures/forniture_kitchen_chair_front_blue.png new file mode 100644 index 00000000..b8f60b32 Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_front_blue.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_front_dark_green.png b/homedecor/textures/forniture_kitchen_chair_front_dark_green.png new file mode 100644 index 00000000..2cc15c24 Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_front_dark_green.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_front_pink.png b/homedecor/textures/forniture_kitchen_chair_front_pink.png new file mode 100644 index 00000000..700003a0 Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_front_pink.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_front_red.png b/homedecor/textures/forniture_kitchen_chair_front_red.png new file mode 100644 index 00000000..62df06d8 Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_front_red.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_front_violet.png b/homedecor/textures/forniture_kitchen_chair_front_violet.png new file mode 100644 index 00000000..4a73c8d6 Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_front_violet.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_sides.png b/homedecor/textures/forniture_kitchen_chair_sides.png new file mode 100644 index 00000000..7e44cea5 Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_sides.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_sides_black.png b/homedecor/textures/forniture_kitchen_chair_sides_black.png new file mode 100644 index 00000000..6d2394d1 Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_sides_black.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_sides_blue.png b/homedecor/textures/forniture_kitchen_chair_sides_blue.png new file mode 100644 index 00000000..ab6daa0f Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_sides_blue.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_sides_dark_green.png b/homedecor/textures/forniture_kitchen_chair_sides_dark_green.png new file mode 100644 index 00000000..5be16b9d Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_sides_dark_green.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_sides_pink.png b/homedecor/textures/forniture_kitchen_chair_sides_pink.png new file mode 100644 index 00000000..6088d9e3 Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_sides_pink.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_sides_red.png b/homedecor/textures/forniture_kitchen_chair_sides_red.png new file mode 100644 index 00000000..cc98a5a4 Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_sides_red.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_sides_violet.png b/homedecor/textures/forniture_kitchen_chair_sides_violet.png new file mode 100644 index 00000000..606e487b Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_sides_violet.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_top.png b/homedecor/textures/forniture_kitchen_chair_top.png new file mode 100644 index 00000000..7e44cea5 Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_top.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_top_black.png b/homedecor/textures/forniture_kitchen_chair_top_black.png new file mode 100644 index 00000000..01b2b066 Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_top_black.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_top_blue.png b/homedecor/textures/forniture_kitchen_chair_top_blue.png new file mode 100644 index 00000000..523aa97e Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_top_blue.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_top_dark_green.png b/homedecor/textures/forniture_kitchen_chair_top_dark_green.png new file mode 100644 index 00000000..d3271d11 Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_top_dark_green.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_top_pink.png b/homedecor/textures/forniture_kitchen_chair_top_pink.png new file mode 100644 index 00000000..f176f757 Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_top_pink.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_top_red.png b/homedecor/textures/forniture_kitchen_chair_top_red.png new file mode 100644 index 00000000..8509a212 Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_top_red.png differ diff --git a/homedecor/textures/forniture_kitchen_chair_top_violet.png b/homedecor/textures/forniture_kitchen_chair_top_violet.png new file mode 100644 index 00000000..4513b935 Binary files /dev/null and b/homedecor/textures/forniture_kitchen_chair_top_violet.png differ