From 4835ba258e00e1df5ad93f71191f900c969eb82f Mon Sep 17 00:00:00 2001 From: sys4 Date: Sat, 2 Jan 2021 18:24:56 +0100 Subject: [PATCH] Add moretrees leaves and use hardware colouring for all leaves --- depends.txt | 1 + snow.lua | 57 +++++++++++++++-------- textures/christmas_aspen_leaves.png | Bin 271 -> 0 bytes textures/christmas_craft_leaves_side.png | Bin 261 -> 0 bytes textures/christmas_craft_leaves_top.png | Bin 261 -> 0 bytes textures/christmas_leaves_side.png | Bin 261 -> 0 bytes textures/christmas_snow_leaves.png | Bin 0 -> 518 bytes 7 files changed, 38 insertions(+), 20 deletions(-) delete mode 100644 textures/christmas_aspen_leaves.png delete mode 100644 textures/christmas_craft_leaves_side.png delete mode 100644 textures/christmas_craft_leaves_top.png delete mode 100644 textures/christmas_leaves_side.png create mode 100644 textures/christmas_snow_leaves.png diff --git a/depends.txt b/depends.txt index e699b0e..be04425 100644 --- a/depends.txt +++ b/depends.txt @@ -3,3 +3,4 @@ youngtrees? bushes? woodsoils? flowers? +moretrees? diff --git a/snow.lua b/snow.lua index 96c491f..4ab362d 100644 --- a/snow.lua +++ b/snow.lua @@ -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 diff --git a/textures/christmas_aspen_leaves.png b/textures/christmas_aspen_leaves.png deleted file mode 100644 index c0e974705e211abec91cf13872e36a1dfd1c4071..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 271 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPHF3h)VWWoTqDlo7U&5w%hfc2*E~ zQ5E%5k?_)$Jg{%ig>z>fK6&u!?aMFUKL7py=W5upM?hVSB|(0{3=Yq3qyagTJzX3_ zIAmE5F627oz|io}{*K7U8fNyUqZW=X7Yd4nSqv?&v9u$qqt^YtBAc@_!q0PPBt;z;kZQ>Jm~i*%rDY8} zu3!4JZNur?)%iRfQ`Y`Yv*0t3O}%m^-biXb$EmufSAqmz9MPPbbD=qj;{&_3m}aZ; T{{~Z_^B6o`{an^LB{Ts5AbM}e diff --git a/textures/christmas_craft_leaves_side.png b/textures/christmas_craft_leaves_side.png deleted file mode 100644 index d5f4749400cdf0849ffc47826b2a6c231930f5a9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 261 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPHF3h)VWWl&^Llb7%m6*ZET_0>?c z)m018lPuR(nj7TNoR)m@;J)iOt~`DE=*Q1*5;Mlx;Tb# z$g&>X$lK%~((v%V&xIE2N$xB%jkAt0mN09)Si5Cw0mJnLi`B%w^gmkD-^92l_K)4B zjM8fih2G2i&uM?${?zYz>-7)QN~E-3{o-s539$b9{Lq7PzvIcwUYES@rNq45&fFQ( zB;M`gabL)WUn6?;JX@6+aSXeiJQ;ZN48v?=%PkV$ZMS!vp>ZMaV0bmqQ4F50elF{r G5}E+V%VVwp diff --git a/textures/christmas_craft_leaves_top.png b/textures/christmas_craft_leaves_top.png deleted file mode 100644 index 3653df3450d077372d83851b97f5654296bbf2f1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 261 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPHF3h)VWWng4fkQVh66*ZET)lrf$ zQJ1pORteNn3)PdXR@cZk5omSNX--Stnwp?~SCI^Xzhu@RgiQg+oMg2-d;AWZHc3;KxS?UP`sks2!yl7t?c z)m018lPuR(nj7TNoR)m@;J)iOt~`DE=*Q1*vge{Rfw~w=g8YIR9G=}s19Cb&T^vI= zWLXbx##u)gOPDoYtlhG;fZ_Ur#cE<-`X8<7Z(`gN`^Rom zM(H(%Lht4M=d?d=f9m(V_4T&2 zF5JQw81cBOj=I@SH+qH{=C}k^bpn%~IBDPvi#{9iD+Y{JHTL;Ql4+7@Rh^zOm~@k| zs>UP(*1KSiRm`gDP2;D{;&kYbv8v`vQ`WJE-KKm4TRjNgVN5a%=S-X?*~I7g0B>8? zNwZj6f-khbv*Mv;+{9h{jbEzjw886GX>%9Nc=105IK?acf!A&1nGZ*JgO6}I$&h4w zNV3yDEZU0${Dg~G>xoCb_wX71!4&iJ3?#YLfJ;jZhW6n{{DsZF_Hn?=C3kiDF5ppB z9pgT}?wc4onRl>)`J~Nxmt!&ACrPd+Sv`yJ&@_MVu3G literal 0 HcmV?d00001