2014-07-19 01:37:08 +02:00
|
|
|
|
2015-04-30 23:52:23 +02:00
|
|
|
local armchair_cbox = {
|
|
|
|
type = "fixed",
|
2016-12-15 22:23:31 +01:00
|
|
|
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 }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-09-23 07:29:06 +02:00
|
|
|
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, {
|
2015-09-23 07:29:06 +02:00
|
|
|
description = "Armchair ("..colour..")",
|
2015-04-07 03:35:25 +02:00
|
|
|
drawtype = "mesh",
|
|
|
|
mesh = "lrfurn_armchair.obj",
|
|
|
|
tiles = {
|
2017-01-25 10:22:28 +01:00
|
|
|
{ name = "lrfurn_upholstery.png", color = hue },
|
2015-04-07 03:35:25 +02:00
|
|
|
"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,
|
2016-07-31 01:17:23 +02:00
|
|
|
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
2014-07-19 01:37:08 +02:00
|
|
|
if not clicker:is_player() then
|
2016-07-31 01:17:23 +02:00
|
|
|
return itemstack
|
2014-07-19 01:37:08 +02:00
|
|
|
end
|
|
|
|
pos.y = pos.y-0.5
|
|
|
|
clicker:setpos(pos)
|
|
|
|
clicker:set_hp(20)
|
2016-07-31 01:17:23 +02:00
|
|
|
return itemstack
|
2014-07-19 01:37:08 +02:00
|
|
|
end
|
|
|
|
})
|
2015-01-20 23:59:50 +01:00
|
|
|
|
2014-07-19 01:37:08 +02:00
|
|
|
minetest.register_craft({
|
|
|
|
output = "lrfurn:armchair_"..colour,
|
|
|
|
recipe = {
|
|
|
|
{"wool:"..colour, "", "", },
|
|
|
|
{"stairs:slab_wood", "", "", },
|
2014-07-31 00:19:42 +02:00
|
|
|
{"group:stick", "", "", }
|
2014-07-19 01:37:08 +02:00
|
|
|
}
|
|
|
|
})
|
2015-01-20 23:59:50 +01:00
|
|
|
|
2014-07-19 01:37:08 +02:00
|
|
|
minetest.register_craft({
|
|
|
|
output = "lrfurn:armchair_"..colour,
|
|
|
|
recipe = {
|
|
|
|
{"wool:"..colour, "", "", },
|
|
|
|
{"moreblocks:slab_wood", "", "", },
|
2014-07-31 00:19:42 +02:00
|
|
|
{"group:stick", "", "", }
|
2014-07-19 01:37:08 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
if minetest.setting_get("log_mods") then
|
|
|
|
minetest.log("action", "armchairs loaded")
|
|
|
|
end
|