Problem consists of what i need to lay flowers textures (from mt_game) on the vase texture, but i don`t understand why edges of faces on which i need to lay flowers textures don`t look like transparent, although that part of vase texture is transparent. Why do faces on the top look like opaque on my screenshot above?
i don`t try to create vase nodes for many colours, i just try to make a few vase nodes with different flowers inside them.
Code: Select all
local flowers_list = {
name = {"rose", "tulip_black", "tulip", "geranium"},
desc = {"Rose", "Tulip Black", "Tulip", "Geranium"}
}
minetest.register_node("luxury_decor:glass_vase", {
description = "Glass Vase",
visual_scale = 0.5,
mesh = "glass_vase.obj",
tiles = {"glass_vase.png"},
use_texture_alpha = true,
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy = 1.5},
drawtype = "mesh",
collision_box = {
type = "fixed",
fixed = {
{-0.2, -0.5, -0.2, 0.2, 0.5, 0.2},
--[[{-0.65, -0.3, -1.46, 0.65, 1.4, -1.66},
{-0.65, -0.3, 0.46, 0.65, 1.4, 0.66}]]
}
},
selection_box = {
type = "fixed",
fixed = {
{-0.2, -0.5, -0.2, 0.2, 0.5, 0.2}
}
},
sounds = default.node_sound_glass_defaults(),
on_rightclick = function (pos, node, clicker, itemstack, pointed_thing)
for _, flower in ipairs(flowers_list.name) do
if "flowers:" .. flower == itemstack:get_name() then
minetest.remove_node(pos)
minetest.set_node(pos, {name="luxury_decor:glass_vase_with_"..flower})
end
end
end
})
for ind, f in pairs(flowers_list.name) do
minetest.register_node("luxury_decor:glass_vase_with_"..f, {
description = "Glass Vase With " .. flowers_list.desc[ind],
visual_scale = 0.5,
mesh = "glass_vase.obj",
tiles = {"glass_vase.png^flowers_"..f..".png"},
use_texture_alpha = true,
paramtype = "light",
paramtype2 = "facedir",
drop = {"luxury_decor:glass_vase", "luxury_decor:glass_vase_with_"..f},
groups = {choppy = 1.5},
drawtype = "mesh",
collision_box = {
type = "fixed",
fixed = {
{-0.2, -0.5, -0.2, 0.2, 0.5, 0.2},
--[[{-0.65, -0.3, -1.46, 0.65, 1.4, -1.66},
{-0.65, -0.3, 0.46, 0.65, 1.4, 0.66}]]
}
},
selection_box = {
type = "fixed",
fixed = {
{-0.2, -0.5, -0.2, 0.2, 0.5, 0.2}
}
},
sounds = default.node_sound_glass_defaults(),
on_rightclick = function (pos, node, clicker, itemstack, pointed_thing)
for _, flower in ipairs(flowers_list.name) do
if "flowers:" .. flower == itemstack:get_name() then
minetest.remove_node(pos)
minetest.set_node(pos, {name="luxury_decor:glass_vase_with_"..flower})
itemstack:add_item("luxury_decor:glass_vase")
itemstack:add_item("flowers:" .. string.sub(node.name, 29))
return itemstack
end
end
minetest.remove_node(pos)
minetest.set_node(pos, {name="luxury_decor:glass_vase"})
itemstack:add_item("flowers:" .. string.sub(node.name, 29))
end
})
end