homedecor_modpack/lrfurn/armchairs.lua

60 lines
1.3 KiB
Lua
Raw Normal View History

2014-07-19 01:37:08 +02:00
2015-04-30 23:52:23 +02:00
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 }
}
}
for i in ipairs(lrfurn.colors) do
local colour = lrfurn.colors[i][1]
local hue = lrfurn.colors[i][2]
2014-07-19 01:37:08 +02:00
minetest.register_node("lrfurn:armchair_"..colour, {
description = "Armchair ("..colour..")",
drawtype = "mesh",
mesh = "lrfurn_armchair.obj",
tiles = {
"lrfurn_bg_white.png^[colorize:"..hue.."^lrfurn_sofa_overlay.png",
"lrfurn_sofa_bottom.png"
},
2014-07-19 01:37:08 +02:00
paramtype = "light",
paramtype2 = "facedir",
2015-04-30 23:52:23 +02:00
groups = {snappy=3},
2014-07-19 01:37:08 +02:00
sounds = default.node_sound_wood_defaults(),
2015-04-30 23:52:23 +02:00
node_box = armchair_cbox,
2014-07-19 01:37:08 +02:00
on_rightclick = function(pos, node, clicker)
if not clicker:is_player() then
return
end
pos.y = pos.y-0.5
clicker:setpos(pos)
clicker:set_hp(20)
end
})
2014-07-19 01:37:08 +02:00
minetest.register_craft({
output = "lrfurn:armchair_"..colour,
recipe = {
{"wool:"..colour, "", "", },
{"stairs:slab_wood", "", "", },
{"group:stick", "", "", }
2014-07-19 01:37:08 +02:00
}
})
2014-07-19 01:37:08 +02:00
minetest.register_craft({
output = "lrfurn:armchair_"..colour,
recipe = {
{"wool:"..colour, "", "", },
{"moreblocks:slab_wood", "", "", },
{"group:stick", "", "", }
2014-07-19 01:37:08 +02:00
}
})
end
if minetest.setting_get("log_mods") then
minetest.log("action", "armchairs loaded")
end