From 3e3ed630e55180d5472ec856c61646018bb99141 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 13 Dec 2019 23:48:13 +0100 Subject: [PATCH] Add per-biome grass coloring --- mods/ITEMS/mcl_core/functions.lua | 11 +- .../textures/mcl_core_palette_grass.png | Bin 138 -> 218 bytes mods/MAPGEN/mcl_biomes/init.lua | 231 ++++++++++++------ mods/MAPGEN/mcl_mapgen_core/init.lua | 4 +- 4 files changed, 166 insertions(+), 80 deletions(-) diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index 40440a425..3c208acb7 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -642,21 +642,16 @@ local grass_spread_randomizer = PseudoRandom(minetest.get_mapgen_setting("seed") -- Return appropriate grass block node for pos function mcl_core.get_grass_block_type(pos) local biome_data = minetest.get_biome_data(pos) - local dry = false + local index = 0 if biome_data then local biome = biome_data.biome local biome_name = minetest.get_biome_name(biome) local reg_biome = minetest.registered_biomes[biome_name] if reg_biome then - local biome_type = reg_biome._mcl_biome_type - dry = biome_type == "hot" + index = reg_biome._mcl_palette_index end end - if dry then - return {name="mcl_core:dirt_with_grass", param2=1} - else - return {name="mcl_core:dirt_with_grass", param2=0} - end + return {name="mcl_core:dirt_with_grass", param2=index} end ------------------------------ diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_palette_grass.png b/mods/ITEMS/mcl_core/textures/mcl_core_palette_grass.png index d338c3433d5a3bc1fc7daad9eabad1fb249c8723..90e5577c93be4678b96fd03c07de243b733e6b8d 100644 GIT binary patch delta 184 zcmV;p07w6d0onnODt{;dGyn?AMSJJ~000SaNLh0L01FcU01FcV0GgZ_00007bV*G` z2jdJ478V3(z*t-W003u6L_t(2&tuFzQfl<~@AVIC3=9lUMDEMHQGCYwp8*D>elva- z{=4n<7i)edhzQHaU*8y**wkh