2014-03-25 14:16:47 +01:00
|
|
|
local S = homedecor.gettext
|
2013-03-26 12:05:22 +01:00
|
|
|
|
2015-05-04 03:18:35 +02:00
|
|
|
local table_colors = {
|
|
|
|
{ "", homedecor.plain_wood },
|
|
|
|
{ "_mahogany", homedecor.mahogany_wood },
|
|
|
|
{ "_white", homedecor.white_wood }
|
|
|
|
}
|
2015-02-25 10:35:29 +01:00
|
|
|
|
2015-05-04 03:18:35 +02:00
|
|
|
for i in ipairs(table_colors) do
|
2015-02-25 10:35:29 +01:00
|
|
|
local desc = S("Table ("..i..")")
|
|
|
|
|
2015-05-04 03:18:35 +02:00
|
|
|
if i == 1 then
|
2015-02-25 10:35:29 +01:00
|
|
|
desc = S("Table")
|
|
|
|
end
|
|
|
|
|
2015-05-04 03:18:35 +02:00
|
|
|
homedecor.register("table"..table_colors[i][1], {
|
2015-02-25 10:35:29 +01:00
|
|
|
description = desc,
|
2015-05-04 03:18:35 +02:00
|
|
|
tiles = { table_colors[i][2] },
|
2015-02-25 10:35:29 +01:00
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{ -0.4, -0.5, -0.4, -0.3, 0.4, -0.3 },
|
|
|
|
{ 0.3, -0.5, -0.4, 0.4, 0.4, -0.3 },
|
|
|
|
{ -0.4, -0.5, 0.3, -0.3, 0.4, 0.4 },
|
|
|
|
{ 0.3, -0.5, 0.3, 0.4, 0.4, 0.4 },
|
|
|
|
{ -0.5, 0.4, -0.5, 0.5, 0.5, 0.5 },
|
|
|
|
{ -0.4, -0.2, -0.3, -0.3, -0.1, 0.3 },
|
|
|
|
{ 0.3, -0.2, -0.4, 0.4, -0.1, 0.3 },
|
|
|
|
{ -0.3, -0.2, -0.4, 0.4, -0.1, -0.3 },
|
|
|
|
{ -0.3, -0.2, 0.3, 0.3, -0.1, 0.4 },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
|
2015-04-29 14:14:36 +02:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2015-02-25 10:35:29 +01:00
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2013-04-03 23:03:42 +02:00
|
|
|
local chaircolors = {
|
2014-06-27 05:20:13 +02:00
|
|
|
{ "", "plain" },
|
2013-04-03 23:03:42 +02:00
|
|
|
{ "black", "Black" },
|
|
|
|
{ "red", "Red" },
|
|
|
|
{ "pink", "Pink" },
|
|
|
|
{ "violet", "Violet" },
|
|
|
|
{ "blue", "Blue" },
|
|
|
|
{ "dark_green", "Dark Green" },
|
|
|
|
}
|
|
|
|
|
2015-04-15 07:52:30 +02:00
|
|
|
local kc_cbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.3125, -0.5, -0.3125, 0.3125, 0.5, 0.3125 },
|
|
|
|
}
|
|
|
|
|
2015-04-30 23:52:23 +02:00
|
|
|
local ac_cbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.5, -0.5, 0.5, 0, 0.5 },
|
|
|
|
{-0.5, -0.5, 0.4, 0.5, 0.5, 0.5 }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-03 23:03:42 +02:00
|
|
|
for i in ipairs(chaircolors) do
|
2014-06-27 05:20:13 +02:00
|
|
|
|
|
|
|
local color = "_"..chaircolors[i][1]
|
|
|
|
local color2 = chaircolors[i][1]
|
2014-03-25 14:16:47 +01:00
|
|
|
local name = S(chaircolors[i][2])
|
2015-01-20 23:59:50 +01:00
|
|
|
local chairtiles = {
|
2015-05-04 03:18:35 +02:00
|
|
|
homedecor.plain_wood,
|
2015-04-15 07:52:30 +02:00
|
|
|
"wool"..color..".png",
|
2014-12-10 19:34:16 +01:00
|
|
|
}
|
2015-04-15 07:52:30 +02:00
|
|
|
|
2015-01-20 23:59:50 +01:00
|
|
|
if chaircolors[i][1] == "" then
|
2014-06-27 05:20:13 +02:00
|
|
|
color = ""
|
2015-04-15 07:52:30 +02:00
|
|
|
chairtiles = {
|
2015-05-04 03:18:35 +02:00
|
|
|
homedecor.plain_wood,
|
|
|
|
homedecor.plain_wood
|
2015-04-15 07:52:30 +02:00
|
|
|
}
|
2014-06-27 05:20:13 +02:00
|
|
|
end
|
|
|
|
|
2015-01-24 00:34:02 +01:00
|
|
|
homedecor.register("chair"..color, {
|
2015-01-23 22:14:00 +01:00
|
|
|
description = S("Kitchen chair (%s)"):format(name),
|
2015-04-15 07:52:30 +02:00
|
|
|
mesh = "homedecor_kitchen_chair.obj",
|
2014-12-10 19:34:16 +01:00
|
|
|
tiles = chairtiles,
|
2015-04-15 07:52:30 +02:00
|
|
|
selection_box = kc_cbox,
|
|
|
|
collision_box = kc_cbox,
|
2014-06-27 05:20:13 +02:00
|
|
|
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
|
2015-04-29 14:14:36 +02:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2015-01-27 19:43:12 +01:00
|
|
|
on_rightclick = function(pos, node, clicker)
|
2015-05-11 20:21:27 +02:00
|
|
|
pos.y = pos.y+0 -- where do I put my ass ?
|
|
|
|
homedecor.sit(pos, node, clicker)
|
|
|
|
end
|
2013-04-03 23:03:42 +02:00
|
|
|
})
|
|
|
|
|
2015-01-20 23:59:50 +01:00
|
|
|
if color ~= "" then
|
2015-01-24 00:34:02 +01:00
|
|
|
homedecor.register("armchair"..color, {
|
2014-06-27 05:20:13 +02:00
|
|
|
description = S("Armchair (%s)"):format(name),
|
2015-03-31 07:04:27 +02:00
|
|
|
mesh = "forniture_armchair.obj",
|
|
|
|
tiles = {
|
|
|
|
"wool"..color..".png",
|
|
|
|
"wool_dark_grey.png",
|
|
|
|
"default_wood.png"
|
2014-06-27 05:20:13 +02:00
|
|
|
},
|
2015-04-30 23:52:23 +02:00
|
|
|
groups = {snappy=3},
|
2015-04-29 14:14:36 +02:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2015-04-30 23:52:23 +02:00
|
|
|
node_box = ac_cbox
|
2014-06-27 05:20:13 +02:00
|
|
|
})
|
2013-04-03 23:03:42 +02:00
|
|
|
|
2014-06-27 05:20:13 +02:00
|
|
|
minetest.register_craft({
|
|
|
|
output = "homedecor:armchair"..color.." 2",
|
|
|
|
recipe = {
|
|
|
|
{ "wool:"..color2,""},
|
|
|
|
{ "group:wood","group:wood" },
|
|
|
|
{ "wool:"..color2,"wool:"..color2 },
|
|
|
|
},
|
|
|
|
})
|
|
|
|
end
|
2013-04-03 23:03:42 +02:00
|
|
|
end
|
2013-03-26 12:05:22 +01:00
|
|
|
|
2015-04-17 15:28:41 +02:00
|
|
|
local ob_cbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.5, -0.5, 0, 0.5, 0.5, 0.5 }
|
|
|
|
}
|
|
|
|
|
2014-07-13 14:35:16 +02:00
|
|
|
minetest.register_node(":homedecor:openframe_bookshelf", {
|
|
|
|
description = "Bookshelf (open-frame)",
|
2015-01-24 01:29:51 +01:00
|
|
|
drawtype = "mesh",
|
2014-12-14 07:19:36 +01:00
|
|
|
mesh = "homedecor_openframe_bookshelf.obj",
|
2015-04-17 15:28:41 +02:00
|
|
|
tiles = {
|
|
|
|
"homedecor_openframe_bookshelf_books.png",
|
|
|
|
"default_wood.png"
|
|
|
|
},
|
2014-07-13 14:35:16 +02:00
|
|
|
groups = {choppy=3,oddly_breakable_by_hand=2,flammable=3},
|
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2015-04-30 23:52:23 +02:00
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
2015-04-17 15:28:41 +02:00
|
|
|
selection_box = ob_cbox,
|
|
|
|
collision_box = ob_cbox,
|
2014-07-13 14:35:16 +02:00
|
|
|
})
|
|
|
|
|
2015-01-24 00:34:02 +01:00
|
|
|
homedecor.register("wall_shelf", {
|
2014-09-10 16:09:06 +02:00
|
|
|
description = "Wall Shelf",
|
|
|
|
tiles = {
|
|
|
|
"homedecor_wood_table_large_edges.png",
|
|
|
|
},
|
2014-09-10 18:00:51 +02:00
|
|
|
groups = { snappy = 3 },
|
2015-04-29 14:14:36 +02:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2014-09-10 16:09:06 +02:00
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, 0.4, 0.47, 0.5, 0.47, 0.5},
|
|
|
|
{-0.5, 0.47, -0.1875, 0.5, 0.5, 0.5}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2013-03-26 12:05:22 +01:00
|
|
|
-- Aliases for 3dforniture mod.
|
2014-08-07 20:49:26 +02:00
|
|
|
|
2013-03-26 12:05:22 +01:00
|
|
|
minetest.register_alias("3dforniture:table", "homedecor:table")
|
|
|
|
minetest.register_alias("3dforniture:chair", "homedecor:chair")
|
2013-04-03 23:03:42 +02:00
|
|
|
minetest.register_alias("3dforniture:armchair", "homedecor:armchair_black")
|
|
|
|
minetest.register_alias("homedecor:armchair", "homedecor:armchair_black")
|
2013-03-26 12:05:22 +01:00
|
|
|
|
|
|
|
minetest.register_alias('table', 'homedecor:table')
|
|
|
|
minetest.register_alias('chair', 'homedecor:chair')
|
|
|
|
minetest.register_alias('armchair', 'homedecor:armchair')
|