1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-27 03:00:38 +01:00
server-nalc/mods/homedecor_modpack/lrfurn/armchairs.lua

79 lines
1.7 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", "", "", }
}
})
2015-01-10 21:42:49 +01:00
minetest.register_craft({
2014-10-28 18:01:32 +01:00
output = "lrfurn:armchair_"..colour,
recipe = {
{"wool:"..colour, "", "", },
{"group:wood_slab", "", "", },
{"group:stick", "", "", }
}
2015-01-10 21:42:49 +01:00
})
2014-10-28 18:01:32 +01:00
end
if minetest.setting_get("log_mods") then
minetest.log("action", "armchairs loaded")
end