More colors for the bed

red, (dark) green, violet
This commit is contained in:
kilbith 2014-08-20 16:11:08 +02:00 committed by Vanessa Ezekowitz
parent 482127af2d
commit 2609e68d9d
29 changed files with 137 additions and 115 deletions

View File

@ -2372,15 +2372,6 @@ minetest.register_craft( {
},
})
minetest.register_craft( {
output = "homedecor:bed_blue_foot",
recipe = {
{ "group:stick", "", "group:stick" },
{ "wool:white", "wool:blue", "wool:blue" },
{ "group:wood", "", "group:wood" },
},
})
minetest.register_craft( {
output = "homedecor:pool_table",
recipe = {
@ -2517,3 +2508,25 @@ minetest.register_craft( {
{ "moreblocks:slab_wood", "", "moreblocks:slab_wood" }
},
})
local bedcolors = {
{ "red", "red"},
{ "green", "dark_green"},
{ "blue", "blue"},
{ "violet", "violet"}
}
for c in ipairs(bedcolors) do
local color = bedcolors[c][1]
local woolcolor = bedcolors[c][2]
minetest.register_craft( {
output = "homedecor:bed_"..color.."_foot",
recipe = {
{ "group:stick", "", "group:stick" },
{ "wool:white", "wool:"..woolcolor, "wool:"..woolcolor },
{ "group:wood", "", "group:wood" },
},
})
end

View File

@ -240,16 +240,30 @@ minetest.register_node(":homedecor:openframe_bookshelf", {
}
})
-- decorative bed and wardrobe, models by jp
local bedcolors = {
"red",
"green",
"blue",
"violet",
}
minetest.register_node("homedecor:bed_blue_head", {
local fdir_to_fwd = {
{ 0, 1 },
{ 1, 0 },
{ 0, -1 },
{ -1, 0 },
}
for _, color in ipairs(bedcolors) do
minetest.register_node("homedecor:bed_"..color.."_head", {
tiles = {
"homedecor_bed_blue_top1.png",
"homedecor_bed_"..color.."_top1.png",
"homedecor_bed_bottom1.png",
"homedecor_bed_blue_side1.png",
"homedecor_bed_blue_side1.png^[transformFX",
"homedecor_bed_blue_head1.png",
"homedecor_bed_blue_head2.png"
"homedecor_bed_"..color.."_side1.png",
"homedecor_bed_"..color.."_side1.png^[transformFX",
"homedecor_bed_"..color.."_head1.png",
"homedecor_bed_"..color.."_head2.png"
},
drawtype = "nodebox",
paramtype = "light",
@ -280,24 +294,17 @@ minetest.register_node("homedecor:bed_blue_head", {
}
})
local fdir_to_fwd = {
{ 0, 1 },
{ 1, 0 },
{ 0, -1 },
{ -1, 0 },
}
minetest.register_node("homedecor:bed_blue_foot", {
minetest.register_node("homedecor:bed_"..color.."_foot", {
tiles = {
"homedecor_bed_blue_top2.png",
"homedecor_bed_"..color.."_top2.png",
"homedecor_bed_bottom2.png",
"homedecor_bed_blue_side2.png",
"homedecor_bed_blue_side2.png^[transformFX",
"homedecor_bed_blue_foot2.png",
"homedecor_bed_blue_foot1.png"
"homedecor_bed_"..color.."_side2.png",
"homedecor_bed_"..color.."_side2.png^[transformFX",
"homedecor_bed_"..color.."_foot2.png",
"homedecor_bed_"..color.."_foot1.png"
},
inventory_image = "homedecor_bed_blue_inv.png",
description = "Bed",
inventory_image = "homedecor_bed_"..color.."_inv.png",
description = S("Bed (%s)"):format(color),
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
@ -342,8 +349,8 @@ minetest.register_node("homedecor:bed_blue_foot", {
and homedecor.get_nodedef_field(tnode2.name, "buildable_to")
and not minetest.is_protected(pos, placer:get_player_name())
and not minetest.is_protected(pos2, placer:get_player_name()) then
minetest.add_node(pos, { name = "homedecor:bed_blue_foot", param2 = fdir })
minetest.add_node(pos2, { name = "homedecor:bed_blue_head", param2 = fdir })
minetest.add_node(pos, { name = "homedecor:bed_"..color.."_foot", param2 = fdir })
minetest.add_node(pos2, { name = "homedecor:bed_"..color.."_head", param2 = fdir })
if not homedecor.expect_infinite_stacks then
itemstack:take_item()
return itemstack
@ -354,12 +361,14 @@ minetest.register_node("homedecor:bed_blue_foot", {
local fdir = oldnode.param2
if not fdir or fdir > 3 then return end
local pos2 = { x = pos.x + fdir_to_fwd[fdir+1][1], y=pos.y, z = pos.z + fdir_to_fwd[fdir+1][2] }
if minetest.get_node(pos2).name == "homedecor:bed_blue_head" then
if minetest.get_node(pos2).name == "homedecor:bed_"..color.."_head" then
minetest.remove_node(pos2)
end
end
})
end
minetest.register_node("homedecor:wardrobe_top", {
tiles = {
"homedecor_wardrobe_top.png",

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 607 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 665 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 B