1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2024-11-17 23:58:30 +01:00
homedecor_modpack/lrfurn/armchairs.lua

62 lines
1.3 KiB
Lua
Raw Normal View History

2014-07-19 01:37:08 +02:00
2017-01-29 22:41:03 +01:00
local S = homedecor_i18n.gettext
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 }
}
}
2017-01-29 22:41:03 +01:00
for i, c in ipairs(lrfurn.colors) do
local colour, coldesc, hue = unpack(c)
2014-07-19 01:37:08 +02:00
minetest.register_node("lrfurn:armchair_"..colour, {
2017-01-29 22:41:03 +01:00
description = S("Armchair (@1)", coldesc),
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
2017-01-29 22:41:03 +01:00
minetest.log("action", "[lrfurn/armchairs] "..S("Loaded!"))
2014-07-19 01:37:08 +02:00
end