homedecor_modpack/lrfurn/armchairs.lua

61 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 = {
2015-04-30 23:52:23 +02:00
{-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 = {
{ name = "lrfurn_upholstery.png", color = hue },
"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,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
2014-07-19 01:37:08 +02:00
if not clicker:is_player() then
return itemstack
2014-07-19 01:37:08 +02:00
end
pos.y = pos.y-0.5
clicker:setpos(pos)
clicker:set_hp(20)
return itemstack
2014-07-19 01:37:08 +02:00
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