Add moretrees leaves and use hardware colouring for all leaves

This commit is contained in:
Sys Quatre 2021-01-02 18:24:56 +01:00
parent 1000a2b34f
commit 4835ba258e
7 changed files with 38 additions and 20 deletions

View File

@ -3,3 +3,4 @@ youngtrees?
bushes?
woodsoils?
flowers?
moretrees?

View File

@ -77,27 +77,44 @@ for _,woodsoil in pairs(woodsoils) do
end
end
local nodebox = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
}
}
local leavesoverride = {
-- drawtype = "nodebox",
-- visual_scale = 1,
-- tiles = {"snow.png", "christmas_craft_leaves_top.png", "christmas_craft_leaves_side.png"},
tiles = {"christmas_craft_leaves_side.png"},
-- paramtype = "light",
-- node_box = nodebox,
-- selection_box = nodebox
}
-- Replace leaves
minetest.override_item("default:pine_needles", {
tiles = {"default_pine_needles.png^christmas_snow_leaves.png"}
})
minetest.override_item("default:pine_bush_needles", {
tiles = {"default_pine_needles.png^christmas_snow_leaves.png"}
})
minetest.override_item("default:bush_leaves", {
tiles = {"(default_leaves.png^[multiply:#c75000)^christmas_snow_leaves.png"}
})
-- replace leaves
minetest.override_item("default:leaves", leavesoverride)
minetest.override_item("default:aspen_leaves", leavesoverride)
minetest.override_item("default:jungleleaves", leavesoverride)
minetest.override_item("default:bush_leaves", leavesoverride)
for _, leaves in pairs({"leaves", "aspen_leaves", "jungleleaves"}) do
local tree_leaves = "default:"..leaves
minetest.override_item(tree_leaves, {
tiles = {
"(default_"..leaves..".png^[multiply:#c75000)^christmas_snow_leaves.png"
}})
end
if minetest.get_modpath("moretrees") then
-- replace moretrees leaves adding snow and brown mask
for _, leaves in pairs({"beech", "apple_tree", "oak", "birch", "poplar", "willow", "rubber_tree"}) do
local tree_leaves = "moretrees:"..leaves.."_leaves"
minetest.override_item(tree_leaves, {
tiles = {
"(moretrees_"..leaves.."_leaves.png^[multiply:#c75000)^christmas_snow_leaves.png"
}})
end
-- replace moretrees leaves adding snow
for _, leaves in pairs({"sequoia", "palm", "date_palm", "spruce", "cedar", "fir"}) do
local tree_leaves = "moretrees:"..leaves.."_leaves"
minetest.override_item(tree_leaves, {
tiles = {
"moretrees_"..leaves.."_leaves.png^christmas_snow_leaves.png"
}})
end
end
-- replace grass
for i=1,5 do

Binary file not shown.

Before

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B