move old 3dforniture-style table into the proper mod

master
Vanessa Dannenberg 2021-03-26 23:17:21 -04:00
parent c70fb1a1ed
commit 950210a6e3
2 changed files with 86 additions and 90 deletions

View File

@ -1,38 +1,5 @@
local S = minetest.get_translator("homedecor_furniture")
local table_colors = {
{ "", S("Table"), homedecor.plain_wood },
{ "_mahogany", S("Mahogany Table"), homedecor.mahogany_wood },
{ "_white", S("White Table"), homedecor.white_wood }
}
for _, t in ipairs(table_colors) do
local suffix, desc, texture = unpack(t)
homedecor.register("table"..suffix, {
description = desc,
tiles = { texture },
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},
sounds = default.node_sound_wood_defaults(),
})
end
local ob_cbox = {
type = "fixed",
fixed = { -0.5, -0.5, 0, 0.5, 0.5, 0.5 }
@ -72,60 +39,6 @@ homedecor.register("wall_shelf", {
-- Crafts
minetest.register_craft({
output = "homedecor:table",
recipe = {
{ "group:wood","group:wood", "group:wood" },
{ "group:stick", "", "group:stick" },
},
})
minetest.register_craft({
type = "shapeless",
output = "homedecor:table_mahogany",
recipe = {
"homedecor:table",
"dye:brown",
},
})
minetest.register_craft({
type = "shapeless",
output = "homedecor:table_mahogany",
recipe = {
"homedecor:table",
"unifieddyes:dark_orange",
},
})
minetest.register_craft({
type = "shapeless",
output = "homedecor:table_white",
recipe = {
"homedecor:table",
"dye:white",
},
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:table",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:table_mahogany",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:table_white",
burntime = 30,
})
minetest.register_craft({
output = "homedecor:standing_lamp_off",
recipe = {

View File

@ -124,6 +124,39 @@ for i, mat in ipairs(tabletop_materials) do
end
-- old-style tables that used to be from 3dforniture.
local table_colors = {
{ "", S("Table"), homedecor.plain_wood },
{ "_mahogany", S("Mahogany Table"), homedecor.mahogany_wood },
{ "_white", S("White Table"), homedecor.white_wood }
}
for _, t in ipairs(table_colors) do
local suffix, desc, texture = unpack(t)
homedecor.register("table"..suffix, {
description = desc,
tiles = { texture },
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},
sounds = default.node_sound_wood_defaults(),
})
end
-- crafting
minetest.register_craft( {
@ -149,8 +182,6 @@ minetest.register_craft( {
}
})
--
minetest.register_craft( {
output = "homedecor:wood_table_small_round_b 15",
recipe = {
@ -243,6 +274,59 @@ for _, shape in ipairs (table_shapes) do
end
end
minetest.register_craft({
output = "homedecor:table",
recipe = {
{ "group:wood","group:wood", "group:wood" },
{ "group:stick", "", "group:stick" },
},
})
minetest.register_craft({
type = "shapeless",
output = "homedecor:table_mahogany",
recipe = {
"homedecor:table",
"dye:brown",
},
})
minetest.register_craft({
type = "shapeless",
output = "homedecor:table_mahogany",
recipe = {
"homedecor:table",
"unifieddyes:dark_orange",
},
})
minetest.register_craft({
type = "shapeless",
output = "homedecor:table_white",
recipe = {
"homedecor:table",
"dye:white",
},
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:table",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:table_mahogany",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:table_white",
burntime = 30,
})
-- recycling
minetest.register_craft({
@ -304,4 +388,3 @@ minetest.register_craft({
"homedecor:wood_table_large"
}
})