1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2025-07-16 04:30:23 +02:00

use mesh node for round-cornered ("small") rugs,

nodebox for square-cornered ("large", "persian") rugs.
This commit is contained in:
Vanessa Ezekowitz
2015-05-11 12:37:49 -04:00
parent a32e723ee2
commit 8e1670e3b9
3 changed files with 278 additions and 14 deletions

View File

@ -24,21 +24,44 @@ homedecor.register("ceiling_tile", {
selection_box = { type = "wallmounted" },
})
local rug_types = {"small", "large", "persian"}
local rug_types = {
{ "small", "homedecor_small_rug.obj" },
{ "large", { -0.5, -0.5, -0.5, 0.5, -0.4375, 0.5 } },
{ "persian", { -0.5, -0.5, -0.5, 0.5, -0.4375, 0.5 } }
}
for _, s in ipairs(rug_types) do
homedecor.register("rug_"..s, {
description = S("Throw Rug ("..s..")"),
drawtype = 'signlike',
tiles = {"homedecor_rug_"..s..".png"},
wield_image = "homedecor_rug_"..s..".png",
inventory_image = "homedecor_rug_"..s..".png",
paramtype2 = "wallmounted",
walkable = false,
groups = {snappy = 3},
sounds = default.node_sound_leaves_defaults(),
selection_box = { type = "wallmounted" },
})
for i in ipairs(rug_types) do
s = rug_types[i][1]
m = rug_types[i][2]
local mesh = m
local nodebox = nil
local tiles = { "homedecor_rug_"..s..".png", "wool_grey.png" }
if type(m) == "table" then
mesh = nil
nodebox = {
type = "fixed",
fixed = m
}
tiles = {
"homedecor_rug_"..s..".png",
"wool_grey.png",
"homedecor_rug_"..s..".png"
}
end
homedecor.register("rug_"..s, {
description = S("Rug ("..s..")"),
mesh = mesh,
tiles = tiles,
node_box = nodebox,
paramtype2 = "wallmounted",
walkable = false,
groups = {snappy = 3},
sounds = default.node_sound_leaves_defaults(),
selection_box = { type = "wallmounted" },
})
end
local pot_colors = {"black", "green", "terracotta"}