1
0
Fork 0

Prepare mcl_beds for multiple colors

This commit is contained in:
Wuzzy 2017-05-07 20:35:22 +02:00
parent d76ab30892
commit 8727aa264b
1 changed files with 40 additions and 31 deletions

View File

@ -13,38 +13,47 @@ local nodebox = {
}, },
} }
mcl_beds.register_bed("mcl_beds:bed_red", { -- TODO: All 16 bed colors
description = "Bed", local colors = {
inventory_image = "mcl_beds_bed_red.png", { "red", "Bed", "group:wool" },
wield_image = "mcl_beds_bed_red.png", }
tiles = {
bottom = { for c=1, #colors do
"mcl_beds_bed_top_bottom_red.png", local colorid = colors[c][1]
"mcl_beds_bed_bottom_bottom.png",
"mcl_beds_bed_side_bottom_r_red.png", mcl_beds.register_bed("mcl_beds:bed_"..colorid, {
"mcl_beds_bed_side_bottom_r_red.png^[transformfx", description = colors[c][2],
"mcl_beds_bed_side_top_red.png", inventory_image = "mcl_beds_bed_"..colorid..".png",
"mcl_beds_bed_side_bottom_red.png" wield_image = "mcl_beds_bed_"..colorid..".png",
tiles = {
bottom = {
"mcl_beds_bed_top_bottom_"..colorid..".png",
"mcl_beds_bed_bottom_bottom.png",
"mcl_beds_bed_side_bottom_r_"..colorid..".png",
"mcl_beds_bed_side_bottom_r_"..colorid..".png^[transformfx",
"mcl_beds_bed_side_top_"..colorid..".png",
"mcl_beds_bed_side_bottom_"..colorid..".png"
},
top = {
"mcl_beds_bed_top_top_"..colorid..".png",
"mcl_beds_bed_bottom_top.png",
"mcl_beds_bed_side_top_r_"..colorid..".png",
"mcl_beds_bed_side_top_r_"..colorid..".png^[transformfx",
"mcl_beds_bed_side_top_"..colorid..".png",
"mcl_beds_bed_side_bottom_"..colorid..".png"
}
}, },
top = { nodebox = nodebox,
"mcl_beds_bed_top_top_red.png", selectionbox = {
"mcl_beds_bed_bottom_top.png", bottom = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
"mcl_beds_bed_side_top_r_red.png", top = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
"mcl_beds_bed_side_top_r_red.png^[transformfx", },
"mcl_beds_bed_side_top_red.png", recipe = {
"mcl_beds_bed_side_bottom_red.png" {colors[c][3], colors[c][3], colors[c][3]},
} {"group:wood", "group:wood", "group:wood"}
}, },
nodebox = nodebox, })
selectionbox = { end
bottom = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
top = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
},
recipe = {
{"group:wool", "group:wool", "group:wool"},
{"group:wood", "group:wood", "group:wood"}
},
})
minetest.register_alias("beds:bed_bottom", "mcl_beds:bed_red_bottom") minetest.register_alias("beds:bed_bottom", "mcl_beds:bed_red_bottom")
minetest.register_alias("beds:bed_top", "mcl_beds:bed_red_top") minetest.register_alias("beds:bed_top", "mcl_beds:bed_red_top")