1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-14 06:20:32 +01:00
server-nalc/mods/homedecor_modpack/lrfurn/armchairs.lua

70 lines
1.5 KiB
Lua
Raw Normal View History

2014-10-28 18:01:32 +01:00
local armchairs_list = {
{ "Red Armchair", "red"},
{ "Orange Armchair", "orange"},
2014-10-28 18:01:32 +01:00
{ "Yellow Armchair", "yellow"},
{ "Green Armchair", "green"},
{ "Blue Armchair", "blue"},
{ "Violet Armchair", "violet"},
{ "Black Armchair", "black"},
{ "Grey Armchair", "grey"},
{ "White Armchair", "white"},
}
local armchair_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 }
}
}
2014-10-28 18:01:32 +01:00
for i in ipairs(armchairs_list) do
local armchairdesc = armchairs_list[i][1]
local colour = armchairs_list[i][2]
minetest.register_node("lrfurn:armchair_"..colour, {
description = armchairdesc,
drawtype = "mesh",
mesh = "lrfurn_armchair.obj",
tiles = {
"lrfurn_sofa_"..colour..".png",
"lrfurn_sofa_bottom.png"
},
2014-10-28 18:01:32 +01:00
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
2014-10-28 18:01:32 +01:00
sounds = default.node_sound_wood_defaults(),
node_box = armchair_cbox,
2014-10-28 18:01:32 +01:00
on_rightclick = function(pos, node, clicker)
if not clicker:is_player() then
return
end
pos.y = pos.y-0.5
clicker:setpos(pos)
end
})
2014-10-28 18:01:32 +01:00
minetest.register_craft({
output = "lrfurn:armchair_"..colour,
recipe = {
{"wool:"..colour, "", "", },
{"stairs:slab_wood", "", "", },
{"group:stick", "", "", }
}
})
2014-10-28 18:01:32 +01:00
minetest.register_craft({
output = "lrfurn:armchair_"..colour,
recipe = {
{"wool:"..colour, "", "", },
{"moreblocks:slab_wood", "", "", },
{"group:stick", "", "", }
}
})
end
if minetest.setting_get("log_mods") then
minetest.log("action", "armchairs loaded")
end