1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2024-12-22 16:10:18 +01:00

Refactor tables and seating

move lrfurn tables to homedecor_tables

create new mod: homedecor_seating

move lrfurn chair, sofas, and all types of homedecor
chairs, benches, etc. that I could think of,
whether intended for exterior or interior use,
to that new mod.

(except tree swing :P )

lrfurn was left empty after this, so deleted.
This commit is contained in:
Vanessa Dannenberg 2019-05-26 20:02:29 -04:00
parent 603eeba810
commit c645964dd5
40 changed files with 815 additions and 846 deletions

View File

@ -34,99 +34,6 @@ homedecor.register("barbecue", {
minetest.register_alias("homedecor:barbecue_meat", "air")
local bl1_sbox = {
type = "fixed",
fixed = { -0.5, -0.5, -0.25, 1.5, 0.5, 0.5 }
}
local bl1_cbox = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.25, 1.5, 0, 0.5 },
{-0.5, -0.5, 0.45, 1.5, 0.5, 0.5 },
}
}
homedecor.register("bench_large_1", {
mesh = "homedecor_bench_large_1.obj",
tiles = {
"homedecor_generic_wood_old.png",
"homedecor_generic_metal_wrought_iron.png"
},
description = S("Garden Bench (style 1)"),
inventory_image = "homedecor_bench_large_1_inv.png",
groups = { snappy = 3 },
expand = { right="placeholder" },
sounds = default.node_sound_wood_defaults(),
selection_box = bl1_sbox,
node_box = bl1_cbox,
on_rotate = screwdriver.disallow
})
minetest.register_alias("homedecor:bench_large_1_left", "homedecor:bench_large_1")
minetest.register_alias("homedecor:bench_large_1_right", "air")
local bl2_sbox = {
type = "fixed",
fixed = { -0.5, -0.5, -0.25, 1.5, 0.5, 0.5 }
}
local bl2_cbox = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.25, 1.5, 0, 0.5 },
{-0.5, -0.5, 0.45, 1.5, 0.5, 0.5 },
}
}
homedecor.register("bench_large_2", {
description = S("Garden Bench (style 2)"),
mesh = "homedecor_bench_large_2.obj",
tiles = { "homedecor_generic_wood_old.png" },
inventory_image = "homedecor_bench_large_2_inv.png",
groups = {snappy=3},
selection_box = bl2_sbox,
node_box = bl2_cbox,
expand = { right="placeholder" },
sounds = default.node_sound_wood_defaults(),
on_rotate = screwdriver.disallow
})
minetest.register_alias("homedecor:bench_large_2_left", "homedecor:bench_large_2")
minetest.register_alias("homedecor:bench_large_2_right", "air")
local dc_cbox = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 1 }
}
homedecor.register("deckchair", {
mesh = "homedecor_deckchair.obj",
tiles = {"homedecor_deckchair.png"},
description = S("Deck Chair"),
groups = { snappy = 3 },
expand = { forward="placeholder" },
sounds = default.node_sound_wood_defaults(),
selection_box = dc_cbox,
collision_box = dc_cbox,
on_rotate = screwdriver.disallow
})
minetest.register_alias("homedecor:deckchair_foot", "homedecor:deckchair")
minetest.register_alias("homedecor:deckchair_head", "air")
homedecor.register("deckchair_striped_blue", {
mesh = "homedecor_deckchair.obj",
tiles = {"homedecor_deckchair_striped_blue.png"},
description = S("Deck Chair (blue striped)"),
groups = { snappy = 3 },
expand = { forward="placeholder" },
sounds = default.node_sound_wood_defaults(),
selection_box = dc_cbox,
collision_box = dc_cbox,
on_rotate = screwdriver.disallow
})
homedecor.register("doghouse", {
mesh = "homedecor_doghouse.obj",
tiles = {
@ -147,21 +54,6 @@ homedecor.register("doghouse", {
minetest.register_alias("homedecor:doghouse_roof", "air")
minetest.register_alias("homedecor:doghouse_base", "homedecor:doghouse")
homedecor.register("simple_bench", {
tiles = { "homedecor_generic_wood_old.png" },
description = S("Simple Bench"),
groups = {snappy=3},
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.15, 0, 0.5, -0.05, 0.4},
{-0.4, -0.5, 0.1, -0.3, -0.15, 0.3},
{ 0.3, -0.5, 0.1, 0.4, -0.15, 0.3},
}
},
sounds = default.node_sound_wood_defaults(),
})
homedecor.register("stonepath", {
description = S("Garden stone path"),
tiles = {
@ -425,72 +317,6 @@ minetest.register_craft( {
},
})
minetest.register_craft( {
output = "homedecor:bench_large_1",
recipe = {
{ "group:wood", "group:wood", "group:wood" },
{ "group:wood", "group:wood", "group:wood" },
{ "homedecor:pole_wrought_iron", "", "homedecor:pole_wrought_iron" }
},
})
minetest.register_craft( {
output = "homedecor:bench_large_2_left",
recipe = {
{ "homedecor:shutter_oak", "homedecor:shutter_oak", "homedecor:shutter_oak" },
{ "group:wood", "group:wood", "group:wood" },
{ "stairs:slab_wood", "", "stairs:slab_wood" }
},
})
minetest.register_craft( {
output = "homedecor:bench_large_2_left",
recipe = {
{ "homedecor:shutter_oak", "homedecor:shutter_oak", "homedecor:shutter_oak" },
{ "group:wood", "group:wood", "group:wood" },
{ "moreblocks:slab_wood", "", "moreblocks:slab_wood" }
},
})
minetest.register_craft( {
output = "homedecor:simple_bench",
recipe = {
{ "stairs:slab_wood", "stairs:slab_wood", "stairs:slab_wood" },
{ "stairs:slab_wood", "", "stairs:slab_wood" }
},
})
minetest.register_craft( {
output = "homedecor:simple_bench",
recipe = {
{ "moreblocks:slab_wood", "moreblocks:slab_wood", "moreblocks:slab_wood" },
{ "moreblocks:slab_wood", "", "moreblocks:slab_wood" }
},
})
minetest.register_craft({
output = "homedecor:deckchair",
recipe = {
{ "group:stick", "building_blocks:terrycloth_towel", "group:stick" },
{ "group:stick", "building_blocks:terrycloth_towel", "group:stick" },
{ "group:stick", "building_blocks:terrycloth_towel", "group:stick" }
},
})
minetest.register_craft({
output = "homedecor:deckchair_striped_blue",
type = "shapeless",
recipe = {
"homedecor:deckchair",
"dye:blue"
}
})
minetest.register_craft({
output = "homedecor:stonepath 16",
recipe = {

View File

@ -32,85 +32,7 @@ for _, t in ipairs(table_colors) do
})
end
local kc_cbox = {
type = "fixed",
fixed = { -0.3125, -0.3125, -0.5, 0.3125, 0.3125, 0.5 },
}
homedecor.register("kitchen_chair_wood", {
description = S("Kitchen chair"),
mesh = "homedecor_kitchen_chair.obj",
tiles = {
homedecor.plain_wood,
homedecor.plain_wood
},
inventory_image = "homedecor_chair_wood_inv.png",
paramtype2 = "wallmounted",
selection_box = kc_cbox,
collision_box = kc_cbox,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
sounds = default.node_sound_wood_defaults(),
after_place_node = unifieddyes.fix_rotation_nsew,
on_rotate = unifieddyes.fix_after_screwdriver_nsew,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
pos.y = pos.y+0 -- where do I put my ass ?
homedecor.sit(pos, node, clicker)
return itemstack
end
})
homedecor.register("kitchen_chair_padded", {
description = S("Kitchen chair"),
mesh = "homedecor_kitchen_chair.obj",
tiles = {
homedecor.plain_wood,
"wool_white.png",
},
inventory_image = "homedecor_chair_padded_inv.png",
paramtype2 = "colorwallmounted",
palette = "unifieddyes_palette_colorwallmounted.png",
selection_box = kc_cbox,
collision_box = kc_cbox,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, ud_param2_colorable = 1},
sounds = default.node_sound_wood_defaults(),
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,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
pos.y = pos.y+0 -- where do I put my ass ?
homedecor.sit(pos, node, clicker)
return itemstack
end
})
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 }
}
}
homedecor.register("armchair", {
description = S("Armchair"),
mesh = "forniture_armchair.obj",
tiles = {
"wool_white.png",
{ name = "wool_dark_grey.png", color = 0xffffffff },
{ name = "default_wood.png", color = 0xffffffff }
},
inventory_image = "homedecor_armchair_inv.png",
paramtype2 = "colorwallmounted",
palette = "unifieddyes_palette_colorwallmounted.png",
groups = {snappy=3, ud_param2_colorable = 1},
sounds = default.node_sound_wood_defaults(),
node_box = ac_cbox,
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,
})
local ob_cbox = {
type = "fixed",
@ -205,73 +127,6 @@ minetest.register_craft({
burntime = 30,
})
minetest.register_craft({
output = "homedecor:kitchen_chair_wood 2",
recipe = {
{ "group:stick",""},
{ "group:wood","group:wood" },
{ "group:stick","group:stick" },
},
})
minetest.register_craft({
output = "homedecor:armchair 2",
recipe = {
{ "wool:white",""},
{ "group:wood","group:wood" },
{ "wool:white","wool:white" },
},
})
unifieddyes.register_color_craft({
output = "homedecor:armchair",
palette = "wallmounted",
type = "shapeless",
neutral_node = "homedecor:armchair",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
minetest.register_craft({
type = "shapeless",
output = "homedecor:kitchen_chair_padded",
recipe = {
"homedecor:kitchen_chair_wood",
"wool:white",
},
})
unifieddyes.register_color_craft({
output = "homedecor:kitchen_chair_padded",
palette = "wallmounted",
type = "shapeless",
neutral_node = "homedecor:kitchen_chair_padded",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:kitchen_chair_wood",
burntime = 15,
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:kitchen_chair_padded",
burntime = 15,
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:armchair",
burntime = 30,
})
minetest.register_craft({
output = "homedecor:standing_lamp_off",
recipe = {
@ -435,95 +290,4 @@ minetest.register_craft({
-- Aliases for 3dforniture mod.
minetest.register_alias("3dforniture:table", "homedecor:table")
minetest.register_alias("3dforniture:chair", "homedecor:chair")
minetest.register_alias("3dforniture:armchair", "homedecor:armchair_black")
minetest.register_alias("homedecor:armchair", "homedecor:armchair_black")
minetest.register_alias('table', 'homedecor:table')
minetest.register_alias('chair', 'homedecor:chair')
minetest.register_alias('armchair', 'homedecor:armchair')
-- conversion to param2 colorization
homedecor.old_static_chairs = {}
local chair_colors = {
"black",
"brown",
"blue",
"cyan",
"dark_grey",
"dark_green",
"green",
"grey",
"magenta",
"orange",
"pink",
"red",
"violet",
"white",
"yellow",
}
for _, color in ipairs(chair_colors) do
table.insert(homedecor.old_static_chairs, "homedecor:chair_"..color)
table.insert(homedecor.old_static_chairs, "homedecor:armchair_"..color)
end
table.insert(homedecor.old_static_chairs, "homedecor:chair")
minetest.register_lbm({
name = ":homedecor:convert_chairs",
label = "Convert homedecor chairs to use param2 color",
run_at_every_load = false,
nodenames = homedecor.old_static_chairs,
action = function(pos, node)
local name = node.name
local paletteidx = 0
local color
local a,b = string.find(name, "_")
if a then
color = string.sub(name, a+1)
if color == "blue" then
color = "medium_blue"
elseif color == "violet" then
color = "medium_violet"
elseif color == "red" then
color = "medium_red"
elseif color == "black" then
color = "dark_grey"
end
paletteidx = unifieddyes.getpaletteidx("unifieddyes:"..color, "wallmounted")
end
local old_fdir = math.floor(node.param2 % 32)
local new_fdir = 3
if old_fdir == 0 then
new_fdir = 3
elseif old_fdir == 1 then
new_fdir = 4
elseif old_fdir == 2 then
new_fdir = 2
elseif old_fdir == 3 then
new_fdir = 5
end
local param2 = paletteidx + new_fdir
local newname = "homedecor:armchair"
if node.name == "homedecor:chair" then
newname = "homedecor:kitchen_chair_wood"
elseif string.find(node.name, "homedecor:chair_") then
newname = "homedecor:kitchen_chair_padded"
end
minetest.set_node(pos, { name = newname, param2 = param2 })
local meta = minetest.get_meta(pos)
if color then
meta:set_string("dye", "unifieddyes:"..color)
end
end
})

View File

@ -90,41 +90,6 @@ homedecor.register("calendar", {
end
})
local ofchairs_sbox = {
type = "fixed",
fixed = { -8/16, -8/16, -8/16, 8/16, 29/32, 8/16 }
}
local ofchairs_cbox = {
type = "fixed",
fixed = {
{ -5/16, 1/16, -7/16, 5/16, 4/16, 7/16 }, -- seat
{ -5/16, 4/16, 4/16, 5/16, 29/32, 15/32 }, -- seatback
{ -1/16, -11/32, -1/16, 1/16, 1/16, 1/16 }, -- cylinder
{ -8/16, -8/16, -8/16, 8/16, -11/32, 8/16 } -- legs/wheels
}
}
local chairs = {
{ "basic", S("Basic office chair") },
{ "upscale", S("Upscale office chair") },
}
for _, c in pairs(chairs) do
local name, desc = unpack(c)
homedecor.register("office_chair_"..name, {
description = desc,
drawtype = "mesh",
tiles = { "homedecor_office_chair_"..name..".png" },
mesh = "homedecor_office_chair_"..name..".obj",
groups = { snappy = 3 },
sounds = default.node_sound_wood_defaults(),
selection_box = ofchairs_sbox,
collision_box = ofchairs_cbox,
expand = { top = "placeholder" },
on_rotate = screwdriver.rotate_simple
})
end
-- crafting
@ -155,24 +120,6 @@ minetest.register_craft({
},
})
minetest.register_craft({
output = "homedecor:office_chair_basic",
recipe = {
{ "", "", "wool:black" },
{ "", "wool:black", "default:steel_ingot" },
{ "group:stick", "homedecor:pole_wrought_iron", "group:stick" }
},
})
minetest.register_craft({
output = "homedecor:office_chair_upscale",
recipe = {
{ "dye:black", "building_blocks:sticks", "group:wool" },
{ "basic_materials:plastic_sheet", "group:wool", "default:steel_ingot" },
{ "building_blocks:sticks", "homedecor:pole_wrought_iron", "building_blocks:sticks" }
},
})
minetest.register_craft({
output = "homedecor:calendar",
recipe = {

View File

@ -8,7 +8,7 @@ local armchair_cbox = {
}
}
minetest.register_node("lrfurn:armchair", {
minetest.register_node(":lrfurn:armchair", {
description = S("Armchair"),
drawtype = "mesh",
mesh = "lrfurn_armchair.obj",
@ -38,6 +38,28 @@ minetest.register_node("lrfurn:armchair", {
end
})
homedecor.register("armchair", {
description = S("Armchair"),
mesh = "forniture_armchair.obj",
tiles = {
"wool_white.png",
{ name = "wool_dark_grey.png", color = 0xffffffff },
{ name = "default_wood.png", color = 0xffffffff }
},
inventory_image = "homedecor_armchair_inv.png",
paramtype2 = "colorwallmounted",
palette = "unifieddyes_palette_colorwallmounted.png",
groups = {snappy=3, ud_param2_colorable = 1},
sounds = default.node_sound_wood_defaults(),
node_box = ac_cbox,
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,
})
-- crafts
minetest.register_craft({
output = "lrfurn:armchair",
recipe = {
@ -67,6 +89,34 @@ unifieddyes.register_color_craft({
}
})
minetest.register_craft({
output = "homedecor:armchair 2",
recipe = {
{ "wool:white",""},
{ "group:wood","group:wood" },
{ "wool:white","wool:white" },
},
})
unifieddyes.register_color_craft({
output = "homedecor:armchair",
palette = "wallmounted",
type = "shapeless",
neutral_node = "homedecor:armchair",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:armchair",
burntime = 30,
})
minetest.register_alias('armchair', 'homedecor:armchair')
-- convert old static nodes to param2 color
lrfurn.old_static_armchairs = {}
@ -76,7 +126,7 @@ for _, color in ipairs(lrfurn.colors) do
end
minetest.register_lbm({
name = "lrfurn:convert_armchairs",
name = ":lrfurn:convert_armchairs",
label = "Convert lrfurn armchairs to use param2 color",
run_at_every_load = false,
nodenames = lrfurn.old_static_armchairs,

View File

@ -1,4 +1,8 @@
-- Home decor seating
-- forked from the previous lrfurn mod
local S = homedecor.gettext
local modpath = minetest.get_modpath("homedecor_seating")
lrfurn = {}
screwdriver = screwdriver or {}
@ -68,8 +72,7 @@ function lrfurn.fix_sofa_rotation_nsew(pos, placer, itemstack, pointed_thing)
minetest.swap_node(pos, { name = node.name, param2 = fdir+colorbits })
end
dofile(minetest.get_modpath("lrfurn").."/longsofas.lua")
dofile(minetest.get_modpath("lrfurn").."/sofas.lua")
dofile(minetest.get_modpath("lrfurn").."/armchairs.lua")
dofile(minetest.get_modpath("lrfurn").."/coffeetable.lua")
dofile(minetest.get_modpath("lrfurn").."/endtable.lua")
dofile(modpath.."/longsofas.lua")
dofile(modpath.."/sofas.lua")
dofile(modpath.."/armchairs.lua")
dofile(modpath.."/misc.lua")

View File

@ -6,7 +6,7 @@ local longsofa_cbox = {
wall_side = {-0.5, -0.5, -0.5, 0.5, 0.5, 2.5},
}
minetest.register_node("lrfurn:longsofa", {
minetest.register_node(":lrfurn:longsofa", {
description = S("Long Sofa"),
drawtype = "mesh",
mesh = "lrfurn_sofa_long.obj",
@ -90,7 +90,7 @@ for _, color in ipairs(lrfurn.colors) do
end
minetest.register_lbm({
name = "lrfurn:convert_longsofas",
name = ":lrfurn:convert_longsofas",
label = "Convert lrfurn long sofas to use param2 color",
run_at_every_load = false,
nodenames = lrfurn.old_static_longsofas,

334
homedecor_seating/misc.lua Normal file
View File

@ -0,0 +1,334 @@
-- this component contains all of the random types of seating previously
-- scattered among homedecor's other mods
local dc_cbox = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 1 }
}
homedecor.register("deckchair", {
mesh = "homedecor_deckchair.obj",
tiles = {"homedecor_deckchair.png"},
description = "Deck Chair",
groups = { snappy = 3 },
expand = { forward="placeholder" },
sounds = default.node_sound_wood_defaults(),
selection_box = dc_cbox,
collision_box = dc_cbox,
on_rotate = screwdriver.disallow
})
minetest.register_alias("homedecor:deckchair_foot", "homedecor:deckchair")
minetest.register_alias("homedecor:deckchair_head", "air")
homedecor.register("deckchair_striped_blue", {
mesh = "homedecor_deckchair.obj",
tiles = {"homedecor_deckchair_striped_blue.png"},
description = "Deck Chair (blue striped)",
groups = { snappy = 3 },
expand = { forward="placeholder" },
sounds = default.node_sound_wood_defaults(),
selection_box = dc_cbox,
collision_box = dc_cbox,
on_rotate = screwdriver.disallow
})
homedecor.register("simple_bench", {
tiles = { "homedecor_generic_wood_old.png" },
description = "Simple Bench",
groups = {snappy=3},
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.15, 0, 0.5, -0.05, 0.4},
{-0.4, -0.5, 0.1, -0.3, -0.15, 0.3},
{ 0.3, -0.5, 0.1, 0.4, -0.15, 0.3},
}
},
sounds = default.node_sound_wood_defaults(),
})
local bl1_sbox = {
type = "fixed",
fixed = { -0.5, -0.5, -0.25, 1.5, 0.5, 0.5 }
}
local bl1_cbox = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.25, 1.5, 0, 0.5 },
{-0.5, -0.5, 0.45, 1.5, 0.5, 0.5 },
}
}
homedecor.register("bench_large_1", {
mesh = "homedecor_bench_large_1.obj",
tiles = {
"homedecor_generic_wood_old.png",
"homedecor_generic_metal_wrought_iron.png"
},
description = "Garden Bench (style 1)",
inventory_image = "homedecor_bench_large_1_inv.png",
groups = { snappy = 3 },
expand = { right="placeholder" },
sounds = default.node_sound_wood_defaults(),
selection_box = bl1_sbox,
node_box = bl1_cbox,
on_rotate = screwdriver.disallow
})
minetest.register_alias("homedecor:bench_large_1_left", "homedecor:bench_large_1")
minetest.register_alias("homedecor:bench_large_1_right", "air")
local bl2_sbox = {
type = "fixed",
fixed = { -0.5, -0.5, -0.25, 1.5, 0.5, 0.5 }
}
local bl2_cbox = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.25, 1.5, 0, 0.5 },
{-0.5, -0.5, 0.45, 1.5, 0.5, 0.5 },
}
}
homedecor.register("bench_large_2", {
description = "Garden Bench (style 2)",
mesh = "homedecor_bench_large_2.obj",
tiles = { "homedecor_generic_wood_old.png" },
inventory_image = "homedecor_bench_large_2_inv.png",
groups = {snappy=3},
selection_box = bl2_sbox,
node_box = bl2_cbox,
expand = { right="placeholder" },
sounds = default.node_sound_wood_defaults(),
on_rotate = screwdriver.disallow
})
minetest.register_alias("homedecor:bench_large_2_left", "homedecor:bench_large_2")
minetest.register_alias("homedecor:bench_large_2_right", "air")
local kc_cbox = {
type = "fixed",
fixed = { -0.3125, -0.3125, -0.5, 0.3125, 0.3125, 0.5 },
}
homedecor.register("kitchen_chair_wood", {
description = "Kitchen chair",
mesh = "homedecor_kitchen_chair.obj",
tiles = {
homedecor.plain_wood,
homedecor.plain_wood
},
inventory_image = "homedecor_chair_wood_inv.png",
paramtype2 = "wallmounted",
selection_box = kc_cbox,
collision_box = kc_cbox,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
sounds = default.node_sound_wood_defaults(),
after_place_node = unifieddyes.fix_rotation_nsew,
on_rotate = unifieddyes.fix_after_screwdriver_nsew,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
pos.y = pos.y+0 -- where do I put my ass ?
homedecor.sit(pos, node, clicker)
return itemstack
end
})
homedecor.register("kitchen_chair_padded", {
description = "Kitchen chair",
mesh = "homedecor_kitchen_chair.obj",
tiles = {
homedecor.plain_wood,
"wool_white.png",
},
inventory_image = "homedecor_chair_padded_inv.png",
paramtype2 = "colorwallmounted",
palette = "unifieddyes_palette_colorwallmounted.png",
selection_box = kc_cbox,
collision_box = kc_cbox,
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, ud_param2_colorable = 1},
sounds = default.node_sound_wood_defaults(),
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,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
pos.y = pos.y+0 -- where do I put my ass ?
homedecor.sit(pos, node, clicker)
return itemstack
end
})
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 }
}
}
local ofchairs_sbox = {
type = "fixed",
fixed = { -8/16, -8/16, -8/16, 8/16, 29/32, 8/16 }
}
local ofchairs_cbox = {
type = "fixed",
fixed = {
{ -5/16, 1/16, -7/16, 5/16, 4/16, 7/16 }, -- seat
{ -5/16, 4/16, 4/16, 5/16, 29/32, 15/32 }, -- seatback
{ -1/16, -11/32, -1/16, 1/16, 1/16, 1/16 }, -- cylinder
{ -8/16, -8/16, -8/16, 8/16, -11/32, 8/16 } -- legs/wheels
}
}
local chairs = {
{ "basic", "Basic office chair" },
{ "upscale", "Upscale office chair" },
}
for _, c in pairs(chairs) do
local name, desc = unpack(c)
homedecor.register("office_chair_"..name, {
description = desc,
drawtype = "mesh",
tiles = { "homedecor_office_chair_"..name..".png" },
mesh = "homedecor_office_chair_"..name..".obj",
groups = { snappy = 3 },
sounds = default.node_sound_wood_defaults(),
selection_box = ofchairs_sbox,
collision_box = ofchairs_cbox,
expand = { top = "placeholder" },
on_rotate = screwdriver.rotate_simple
})
end
-- crafts!
minetest.register_craft( {
output = "homedecor:bench_large_1",
recipe = {
{ "group:wood", "group:wood", "group:wood" },
{ "group:wood", "group:wood", "group:wood" },
{ "homedecor:pole_wrought_iron", "", "homedecor:pole_wrought_iron" }
},
})
minetest.register_craft( {
output = "homedecor:bench_large_2_left",
recipe = {
{ "homedecor:shutter_oak", "homedecor:shutter_oak", "homedecor:shutter_oak" },
{ "group:wood", "group:wood", "group:wood" },
{ "stairs:slab_wood", "", "stairs:slab_wood" }
},
})
minetest.register_craft( {
output = "homedecor:bench_large_2_left",
recipe = {
{ "homedecor:shutter_oak", "homedecor:shutter_oak", "homedecor:shutter_oak" },
{ "group:wood", "group:wood", "group:wood" },
{ "moreblocks:slab_wood", "", "moreblocks:slab_wood" }
},
})
minetest.register_craft( {
output = "homedecor:simple_bench",
recipe = {
{ "stairs:slab_wood", "stairs:slab_wood", "stairs:slab_wood" },
{ "stairs:slab_wood", "", "stairs:slab_wood" }
},
})
minetest.register_craft( {
output = "homedecor:simple_bench",
recipe = {
{ "moreblocks:slab_wood", "moreblocks:slab_wood", "moreblocks:slab_wood" },
{ "moreblocks:slab_wood", "", "moreblocks:slab_wood" }
},
})
minetest.register_craft({
output = "homedecor:deckchair",
recipe = {
{ "group:stick", "building_blocks:terrycloth_towel", "group:stick" },
{ "group:stick", "building_blocks:terrycloth_towel", "group:stick" },
{ "group:stick", "building_blocks:terrycloth_towel", "group:stick" }
},
})
minetest.register_craft({
output = "homedecor:deckchair_striped_blue",
type = "shapeless",
recipe = {
"homedecor:deckchair",
"dye:blue"
}
})
minetest.register_craft({
output = "homedecor:kitchen_chair_wood 2",
recipe = {
{ "group:stick",""},
{ "group:wood","group:wood" },
{ "group:stick","group:stick" },
},
})
minetest.register_craft({
type = "shapeless",
output = "homedecor:kitchen_chair_padded",
recipe = {
"homedecor:kitchen_chair_wood",
"wool:white",
},
})
unifieddyes.register_color_craft({
output = "homedecor:kitchen_chair_padded",
palette = "wallmounted",
type = "shapeless",
neutral_node = "homedecor:kitchen_chair_padded",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:kitchen_chair_wood",
burntime = 15,
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:kitchen_chair_padded",
burntime = 15,
})
minetest.register_craft({
output = "homedecor:office_chair_basic",
recipe = {
{ "", "", "wool:black" },
{ "", "wool:black", "default:steel_ingot" },
{ "group:stick", "homedecor:pole_wrought_iron", "group:stick" }
},
})
minetest.register_craft({
output = "homedecor:office_chair_upscale",
recipe = {
{ "dye:black", "building_blocks:sticks", "group:wool" },
{ "basic_materials:plastic_sheet", "group:wool", "default:steel_ingot" },
{ "building_blocks:sticks", "homedecor:pole_wrought_iron", "building_blocks:sticks" }
},
})
-- aliases
minetest.register_alias("3dforniture:chair", "homedecor:chair")
minetest.register_alias('chair', 'homedecor:chair')

View File

@ -6,7 +6,7 @@ local sofa_cbox = {
wall_side = {-0.5, -0.5, -0.5, 0.5, 0.5, 1.5}
}
minetest.register_node("lrfurn:sofa", {
minetest.register_node(":lrfurn:sofa", {
description = S("Sofa"),
drawtype = "mesh",
mesh = "lrfurn_sofa_short.obj",
@ -90,7 +90,7 @@ for _, color in ipairs(lrfurn.colors) do
end
minetest.register_lbm({
name = "lrfurn:convert_sofas",
name = ":lrfurn:convert_sofas",
label = "Convert lrfurn short sofas to use param2 color",
run_at_every_load = false,
nodenames = lrfurn.old_static_sofas,

View File

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 314 B

After

Width:  |  Height:  |  Size: 314 B

View File

Before

Width:  |  Height:  |  Size: 355 B

After

Width:  |  Height:  |  Size: 355 B

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 642 B

After

Width:  |  Height:  |  Size: 642 B

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -1,10 +1,49 @@
-- formerly lrfurn coffee table component
local S = homedecor.gettext
local fdir_to_right = {
{ 1, 0 },
{ 0, -1 },
{ -1, 0 },
{ 0, 1 },
}
local function check_right(pos, fdir, long, placer)
if not fdir or fdir > 3 then fdir = 0 end
local pos2 = { x = pos.x + fdir_to_right[fdir+1][1], y=pos.y, z = pos.z + fdir_to_right[fdir+1][2] }
local pos3 = { x = pos.x + fdir_to_right[fdir+1][1] * 2, y=pos.y, z = pos.z + fdir_to_right[fdir+1][2] * 2 }
local node2 = minetest.get_node(pos2)
if node2 and node2.name ~= "air" then
return false
elseif minetest.is_protected(pos2, placer:get_player_name()) then
if not long then
minetest.chat_send_player(placer:get_player_name(), S("Someone else owns the spot where other end goes!"))
else
minetest.chat_send_player(placer:get_player_name(), S("Someone else owns the spot where the middle or far end goes!"))
end
return false
end
if long then
local node3 = minetest.get_node(pos3)
if node3 and node3.name ~= "air" then
return false
elseif minetest.is_protected(pos3, placer:get_player_name()) then
minetest.chat_send_player(placer:get_player_name(), S("Someone else owns the spot where the other end goes!"))
return false
end
end
return true
end
minetest.register_alias("lrfurn:coffeetable_back", "lrfurn:coffeetable")
minetest.register_alias("lrfurn:coffeetable_front", "air")
minetest.register_node("lrfurn:coffeetable", {
minetest.register_node(":lrfurn:coffeetable", {
description = S("Coffee Table"),
drawtype = "nodebox",
tiles = {"lrfurn_coffeetable_back.png", "lrfurn_coffeetable_back.png", "lrfurn_coffeetable_back.png", "lrfurn_coffeetable_back.png", "lrfurn_coffeetable_back.png", "lrfurn_coffeetable_back.png"},
@ -36,7 +75,7 @@ minetest.register_node("lrfurn:coffeetable", {
local node = minetest.get_node(pos)
local fdir = node.param2
if lrfurn.check_right(pos, fdir, false, placer) then
if check_right(pos, fdir, false, placer) then
minetest.set_node(pos, { name = node.name, param2 = (fdir + 1) % 4 })
else
minetest.chat_send_player(placer:get_player_name(),

View File

@ -1,7 +1,8 @@
-- formerly lrfurn endtable component
local S = homedecor.gettext
minetest.register_node("lrfurn:endtable", {
minetest.register_node(":lrfurn:endtable", {
description = S("End Table"),
drawtype = "nodebox",
tiles = {"lrfurn_coffeetable_back.png", "lrfurn_coffeetable_back.png", "lrfurn_coffeetable_back.png", "lrfurn_coffeetable_back.png", "lrfurn_coffeetable_back.png", "lrfurn_coffeetable_back.png"},

View File

@ -1,371 +1,6 @@
local modpath = minetest.get_modpath("homedecor_tables")
local S = homedecor.gettext
dofile(modpath.."/misc.lua")
dofile(modpath.."/endtable.lua")
dofile(modpath.."/coffeetable.lua")
-- Various kinds of tables
local materials = {
{ "glass",
S("Small square glass table"),
S("Small round glass table"),
S("Large glass table piece"),
},
{ "wood",
S("Small square wooden table"),
S("Small round wooden table"),
S("Large wooden table piece"),
}
}
local tables_cbox = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, -0.4375, 0.5 },
}
for i, mat in ipairs(materials) do
local m, small_s, small_r, large = unpack(mat)
local s
if m == "glass" then
s = default.node_sound_glass_defaults()
else
s = default.node_sound_wood_defaults()
end
-- small square tables
homedecor.register(m.."_table_small_square", {
description = small_s,
mesh = "homedecor_table_small_square.obj",
tiles = { 'homedecor_'..m..'_table_small_square.png' },
wield_image = 'homedecor_'..m..'_table_small_square_inv.png',
inventory_image = 'homedecor_'..m..'_table_small_square_inv.png',
groups = { snappy = 3 },
sounds = s,
selection_box = tables_cbox,
collision_box = tables_cbox,
on_place = minetest.rotate_node
})
-- small round tables
homedecor.register(m..'_table_small_round', {
description = small_r,
mesh = "homedecor_table_small_round.obj",
tiles = { "homedecor_"..m.."_table_small_round.png" },
wield_image = 'homedecor_'..m..'_table_small_round_inv.png',
inventory_image = 'homedecor_'..m..'_table_small_round_inv.png',
groups = { snappy = 3 },
sounds = s,
selection_box = tables_cbox,
collision_box = tables_cbox,
on_place = minetest.rotate_node
})
-- Large square table pieces
homedecor.register(m..'_table_large', {
description = large,
tiles = {
'homedecor_'..m..'_table_large_tb.png',
'homedecor_'..m..'_table_large_tb.png',
'homedecor_'..m..'_table_large_edges.png',
'homedecor_'..m..'_table_large_edges.png',
'homedecor_'..m..'_table_large_edges.png',
'homedecor_'..m..'_table_large_edges.png'
},
wield_image = 'homedecor_'..m..'_table_large_inv.png',
inventory_image = 'homedecor_'..m..'_table_large_inv.png',
groups = { snappy = 3 },
sounds = s,
node_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, -0.4375, 0.5 },
},
selection_box = tables_cbox,
on_place = minetest.rotate_node
})
minetest.register_alias('homedecor:'..m..'_table_large_b', 'homedecor:'..m..'_table_large')
minetest.register_alias('homedecor:'..m..'_table_small_square_b', 'homedecor:'..m..'_table_small_square')
minetest.register_alias('homedecor:'..m..'_table_small_round_b', 'homedecor:'..m..'_table_small_round')
end
-- conversion routines for old non-6dfacedir tables
local tlist_s = {}
local tlist_t = {}
local dirs2 = { 9, 18, 7, 12 }
for i in ipairs(materials) do
local m = materials[i][1]
table.insert(tlist_s, "homedecor:"..m.."_table_large_s")
table.insert(tlist_s, "homedecor:"..m.."_table_small_square_s")
table.insert(tlist_s, "homedecor:"..m.."_table_small_round_s")
table.insert(tlist_t, "homedecor:"..m.."_table_large_t")
table.insert(tlist_t, "homedecor:"..m.."_table_small_square_t")
table.insert(tlist_t, "homedecor:"..m.."_table_small_round_t")
end
minetest.register_abm({
nodenames = tlist_s,
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local newnode = string.sub(node.name, 1, -3) -- strip the "_s" from the name
local fdir = node.param2 or 0
minetest.set_node(pos, {name = newnode, param2 = dirs2[fdir+1]})
end
})
minetest.register_abm({
nodenames = tlist_t,
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local newnode = string.sub(node.name, 1, -3) -- strip the "_t" from the name
minetest.set_node(pos, { name = newnode, param2 = 20 })
end
})
-- other tables
homedecor.register("utility_table_top", {
description = S("Utility Table"),
tiles = {
'homedecor_utility_table_tb.png',
'homedecor_utility_table_tb.png',
'homedecor_utility_table_edges.png',
'homedecor_utility_table_edges.png',
'homedecor_utility_table_edges.png',
'homedecor_utility_table_edges.png'
},
wield_image = 'homedecor_utility_table_tb.png',
inventory_image = 'homedecor_utility_table_tb.png',
groups = { snappy = 3 },
sounds = default.node_sound_wood_defaults(),
paramtype2 = "wallmounted",
node_box = {
type = "wallmounted",
wall_bottom = { -0.5, -0.5, -0.5, 0.5, -0.4375, 0.5 },
wall_top = { -0.5, 0.4375, -0.5, 0.5, 0.5, 0.5 },
wall_side = { -0.5, -0.5, -0.5, -0.4375, 0.5, 0.5 },
},
selection_box = {
type = "wallmounted",
wall_bottom = { -0.5, -0.5, -0.5, 0.5, -0.4375, 0.5 },
wall_top = { -0.5, 0.4375, -0.5, 0.5, 0.5, 0.5 },
wall_side = { -0.5, -0.5, -0.5, -0.4375, 0.5, 0.5 },
},
})
-- Various kinds of table legs
-- local above
materials = {
{ "brass", S("brass") },
{ "wrought_iron", S("wrought iron") },
}
for _, t in ipairs(materials) do
local name, desc = unpack(t)
homedecor.register("table_legs_"..name, {
description = S("Table Legs (@1)", desc),
drawtype = "plantlike",
tiles = {"homedecor_table_legs_"..name..".png"},
inventory_image = "homedecor_table_legs_"..name..".png",
wield_image = "homedecor_table_legs_"..name..".png",
walkable = false,
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.37, -0.5, -0.37, 0.37, 0.5, 0.37 }
},
})
end
homedecor.register("utility_table_legs", {
description = S("Legs for Utility Table"),
drawtype = "plantlike",
tiles = { 'homedecor_utility_table_legs.png' },
inventory_image = 'homedecor_utility_table_legs_inv.png',
wield_image = 'homedecor_utility_table_legs.png',
walkable = false,
groups = { snappy = 3 },
sounds = default.node_sound_wood_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.37, -0.5, -0.37, 0.37, 0.5, 0.37 }
},
})
-- crafting
minetest.register_craft( {
output = "homedecor:glass_table_small_round_b 15",
recipe = {
{ "", "default:glass", "" },
{ "default:glass", "default:glass", "default:glass" },
{ "", "default:glass", "" },
},
})
minetest.register_craft( {
output = "homedecor:glass_table_small_square_b 2",
recipe = {
{"homedecor:glass_table_small_round", "homedecor:glass_table_small_round" },
}
})
minetest.register_craft( {
output = "homedecor:glass_table_large_b 2",
recipe = {
{ "homedecor:glass_table_small_square", "homedecor:glass_table_small_square" },
}
})
--
minetest.register_craft( {
output = "homedecor:wood_table_small_round_b 15",
recipe = {
{ "", "group:wood", "" },
{ "group:wood", "group:wood", "group:wood" },
{ "", "group:wood", "" },
},
})
minetest.register_craft( {
output = "homedecor:wood_table_small_square_b 2",
recipe = {
{ "homedecor:wood_table_small_round","homedecor:wood_table_small_round" },
}
})
minetest.register_craft( {
output = "homedecor:wood_table_large_b 2",
recipe = {
{ "homedecor:wood_table_small_square", "homedecor:wood_table_small_square" },
}
})
--
minetest.register_craft({
type = "fuel",
recipe = "homedecor:wood_table_small_round_b",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:wood_table_small_square_b",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:wood_table_large_b",
burntime = 30,
})
minetest.register_craft( {
output = "homedecor:table_legs_wrought_iron 3",
recipe = {
{ "", "default:iron_lump", "" },
{ "", "default:iron_lump", "" },
{ "default:iron_lump", "default:iron_lump", "default:iron_lump" },
},
})
minetest.register_craft( {
output = "homedecor:table_legs_brass 3",
recipe = {
{ "", "basic_materials:brass_ingot", "" },
{ "", "basic_materials:brass_ingot", "" },
{ "basic_materials:brass_ingot", "basic_materials:brass_ingot", "basic_materials:brass_ingot" }
},
})
minetest.register_craft( {
output = "homedecor:utility_table_legs",
recipe = {
{ "group:stick", "group:stick", "group:stick" },
{ "group:stick", "", "group:stick" },
{ "group:stick", "", "group:stick" },
},
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:utility_table_legs",
burntime = 30,
})
-- recycling
minetest.register_craft({
type = "shapeless",
output = "vessels:glass_fragments",
recipe = {
"homedecor:glass_table_small_round",
"homedecor:glass_table_small_round",
"homedecor:glass_table_small_round"
}
})
minetest.register_craft({
type = "shapeless",
output = "vessels:glass_fragments",
recipe = {
"homedecor:glass_table_small_square",
"homedecor:glass_table_small_square",
"homedecor:glass_table_small_square"
}
})
minetest.register_craft({
type = "shapeless",
output = "vessels:glass_fragments",
recipe = {
"homedecor:glass_table_large",
"homedecor:glass_table_large",
"homedecor:glass_table_large"
}
})
minetest.register_craft({
type = "shapeless",
output = "default:stick 4",
recipe = {
"homedecor:wood_table_small_round",
"homedecor:wood_table_small_round",
"homedecor:wood_table_small_round"
}
})
minetest.register_craft({
type = "shapeless",
output = "default:stick 4",
recipe = {
"homedecor:wood_table_small_square",
"homedecor:wood_table_small_square",
"homedecor:wood_table_small_square"
}
})
minetest.register_craft({
type = "shapeless",
output = "default:stick 4",
recipe = {
"homedecor:wood_table_large",
"homedecor:wood_table_large",
"homedecor:wood_table_large"
}
})

370
homedecor_tables/misc.lua Normal file
View File

@ -0,0 +1,370 @@
-- formerly homedecor's misc tables component
local S = homedecor.gettext
local materials = {
{ "glass",
S("Small square glass table"),
S("Small round glass table"),
S("Large glass table piece"),
},
{ "wood",
S("Small square wooden table"),
S("Small round wooden table"),
S("Large wooden table piece"),
}
}
local tables_cbox = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, -0.4375, 0.5 },
}
for i, mat in ipairs(materials) do
local m, small_s, small_r, large = unpack(mat)
local s
if m == "glass" then
s = default.node_sound_glass_defaults()
else
s = default.node_sound_wood_defaults()
end
-- small square tables
homedecor.register(m.."_table_small_square", {
description = small_s,
mesh = "homedecor_table_small_square.obj",
tiles = { 'homedecor_'..m..'_table_small_square.png' },
wield_image = 'homedecor_'..m..'_table_small_square_inv.png',
inventory_image = 'homedecor_'..m..'_table_small_square_inv.png',
groups = { snappy = 3 },
sounds = s,
selection_box = tables_cbox,
collision_box = tables_cbox,
on_place = minetest.rotate_node
})
-- small round tables
homedecor.register(m..'_table_small_round', {
description = small_r,
mesh = "homedecor_table_small_round.obj",
tiles = { "homedecor_"..m.."_table_small_round.png" },
wield_image = 'homedecor_'..m..'_table_small_round_inv.png',
inventory_image = 'homedecor_'..m..'_table_small_round_inv.png',
groups = { snappy = 3 },
sounds = s,
selection_box = tables_cbox,
collision_box = tables_cbox,
on_place = minetest.rotate_node
})
-- Large square table pieces
homedecor.register(m..'_table_large', {
description = large,
tiles = {
'homedecor_'..m..'_table_large_tb.png',
'homedecor_'..m..'_table_large_tb.png',
'homedecor_'..m..'_table_large_edges.png',
'homedecor_'..m..'_table_large_edges.png',
'homedecor_'..m..'_table_large_edges.png',
'homedecor_'..m..'_table_large_edges.png'
},
wield_image = 'homedecor_'..m..'_table_large_inv.png',
inventory_image = 'homedecor_'..m..'_table_large_inv.png',
groups = { snappy = 3 },
sounds = s,
node_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, -0.4375, 0.5 },
},
selection_box = tables_cbox,
on_place = minetest.rotate_node
})
minetest.register_alias('homedecor:'..m..'_table_large_b', 'homedecor:'..m..'_table_large')
minetest.register_alias('homedecor:'..m..'_table_small_square_b', 'homedecor:'..m..'_table_small_square')
minetest.register_alias('homedecor:'..m..'_table_small_round_b', 'homedecor:'..m..'_table_small_round')
end
-- conversion routines for old non-6dfacedir tables
local tlist_s = {}
local tlist_t = {}
local dirs2 = { 9, 18, 7, 12 }
for i in ipairs(materials) do
local m = materials[i][1]
table.insert(tlist_s, "homedecor:"..m.."_table_large_s")
table.insert(tlist_s, "homedecor:"..m.."_table_small_square_s")
table.insert(tlist_s, "homedecor:"..m.."_table_small_round_s")
table.insert(tlist_t, "homedecor:"..m.."_table_large_t")
table.insert(tlist_t, "homedecor:"..m.."_table_small_square_t")
table.insert(tlist_t, "homedecor:"..m.."_table_small_round_t")
end
minetest.register_abm({
nodenames = tlist_s,
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local newnode = string.sub(node.name, 1, -3) -- strip the "_s" from the name
local fdir = node.param2 or 0
minetest.set_node(pos, {name = newnode, param2 = dirs2[fdir+1]})
end
})
minetest.register_abm({
nodenames = tlist_t,
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local newnode = string.sub(node.name, 1, -3) -- strip the "_t" from the name
minetest.set_node(pos, { name = newnode, param2 = 20 })
end
})
-- other tables
homedecor.register("utility_table_top", {
description = S("Utility Table"),
tiles = {
'homedecor_utility_table_tb.png',
'homedecor_utility_table_tb.png',
'homedecor_utility_table_edges.png',
'homedecor_utility_table_edges.png',
'homedecor_utility_table_edges.png',
'homedecor_utility_table_edges.png'
},
wield_image = 'homedecor_utility_table_tb.png',
inventory_image = 'homedecor_utility_table_tb.png',
groups = { snappy = 3 },
sounds = default.node_sound_wood_defaults(),
paramtype2 = "wallmounted",
node_box = {
type = "wallmounted",
wall_bottom = { -0.5, -0.5, -0.5, 0.5, -0.4375, 0.5 },
wall_top = { -0.5, 0.4375, -0.5, 0.5, 0.5, 0.5 },
wall_side = { -0.5, -0.5, -0.5, -0.4375, 0.5, 0.5 },
},
selection_box = {
type = "wallmounted",
wall_bottom = { -0.5, -0.5, -0.5, 0.5, -0.4375, 0.5 },
wall_top = { -0.5, 0.4375, -0.5, 0.5, 0.5, 0.5 },
wall_side = { -0.5, -0.5, -0.5, -0.4375, 0.5, 0.5 },
},
})
-- Various kinds of table legs
-- local above
materials = {
{ "brass", S("brass") },
{ "wrought_iron", S("wrought iron") },
}
for _, t in ipairs(materials) do
local name, desc = unpack(t)
homedecor.register("table_legs_"..name, {
description = S("Table Legs (@1)", desc),
drawtype = "plantlike",
tiles = {"homedecor_table_legs_"..name..".png"},
inventory_image = "homedecor_table_legs_"..name..".png",
wield_image = "homedecor_table_legs_"..name..".png",
walkable = false,
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.37, -0.5, -0.37, 0.37, 0.5, 0.37 }
},
})
end
homedecor.register("utility_table_legs", {
description = S("Legs for Utility Table"),
drawtype = "plantlike",
tiles = { 'homedecor_utility_table_legs.png' },
inventory_image = 'homedecor_utility_table_legs_inv.png',
wield_image = 'homedecor_utility_table_legs.png',
walkable = false,
groups = { snappy = 3 },
sounds = default.node_sound_wood_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.37, -0.5, -0.37, 0.37, 0.5, 0.37 }
},
})
-- crafting
minetest.register_craft( {
output = "homedecor:glass_table_small_round_b 15",
recipe = {
{ "", "default:glass", "" },
{ "default:glass", "default:glass", "default:glass" },
{ "", "default:glass", "" },
},
})
minetest.register_craft( {
output = "homedecor:glass_table_small_square_b 2",
recipe = {
{"homedecor:glass_table_small_round", "homedecor:glass_table_small_round" },
}
})
minetest.register_craft( {
output = "homedecor:glass_table_large_b 2",
recipe = {
{ "homedecor:glass_table_small_square", "homedecor:glass_table_small_square" },
}
})
--
minetest.register_craft( {
output = "homedecor:wood_table_small_round_b 15",
recipe = {
{ "", "group:wood", "" },
{ "group:wood", "group:wood", "group:wood" },
{ "", "group:wood", "" },
},
})
minetest.register_craft( {
output = "homedecor:wood_table_small_square_b 2",
recipe = {
{ "homedecor:wood_table_small_round","homedecor:wood_table_small_round" },
}
})
minetest.register_craft( {
output = "homedecor:wood_table_large_b 2",
recipe = {
{ "homedecor:wood_table_small_square", "homedecor:wood_table_small_square" },
}
})
--
minetest.register_craft({
type = "fuel",
recipe = "homedecor:wood_table_small_round_b",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:wood_table_small_square_b",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:wood_table_large_b",
burntime = 30,
})
minetest.register_craft( {
output = "homedecor:table_legs_wrought_iron 3",
recipe = {
{ "", "default:iron_lump", "" },
{ "", "default:iron_lump", "" },
{ "default:iron_lump", "default:iron_lump", "default:iron_lump" },
},
})
minetest.register_craft( {
output = "homedecor:table_legs_brass 3",
recipe = {
{ "", "basic_materials:brass_ingot", "" },
{ "", "basic_materials:brass_ingot", "" },
{ "basic_materials:brass_ingot", "basic_materials:brass_ingot", "basic_materials:brass_ingot" }
},
})
minetest.register_craft( {
output = "homedecor:utility_table_legs",
recipe = {
{ "group:stick", "group:stick", "group:stick" },
{ "group:stick", "", "group:stick" },
{ "group:stick", "", "group:stick" },
},
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:utility_table_legs",
burntime = 30,
})
-- recycling
minetest.register_craft({
type = "shapeless",
output = "vessels:glass_fragments",
recipe = {
"homedecor:glass_table_small_round",
"homedecor:glass_table_small_round",
"homedecor:glass_table_small_round"
}
})
minetest.register_craft({
type = "shapeless",
output = "vessels:glass_fragments",
recipe = {
"homedecor:glass_table_small_square",
"homedecor:glass_table_small_square",
"homedecor:glass_table_small_square"
}
})
minetest.register_craft({
type = "shapeless",
output = "vessels:glass_fragments",
recipe = {
"homedecor:glass_table_large",
"homedecor:glass_table_large",
"homedecor:glass_table_large"
}
})
minetest.register_craft({
type = "shapeless",
output = "default:stick 4",
recipe = {
"homedecor:wood_table_small_round",
"homedecor:wood_table_small_round",
"homedecor:wood_table_small_round"
}
})
minetest.register_craft({
type = "shapeless",
output = "default:stick 4",
recipe = {
"homedecor:wood_table_small_square",
"homedecor:wood_table_small_square",
"homedecor:wood_table_small_square"
}
})
minetest.register_craft({
type = "shapeless",
output = "default:stick 4",
recipe = {
"homedecor:wood_table_large",
"homedecor:wood_table_large",
"homedecor:wood_table_large"
}
})

View File

Before

Width:  |  Height:  |  Size: 488 B

After

Width:  |  Height:  |  Size: 488 B

View File

Before

Width:  |  Height:  |  Size: 473 B

After

Width:  |  Height:  |  Size: 473 B