From de00b7228e1db40d04f6bf224e600c2e38ef05ea Mon Sep 17 00:00:00 2001 From: Michieal Date: Sun, 5 Feb 2023 21:17:53 -0500 Subject: [PATCH 1/2] Fix "mcl_core:dirt_with_dry_grass" to be "mcl_core:dirt_with_grass" with the savanna color index. --- mods/ITEMS/mcl_core/functions.lua | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index 19c56b4d3..2fa8489e0 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -928,27 +928,15 @@ minetest.register_lbm({ name = "mcl_core:replace_legacy_dry_grass_0_65_0", nodenames = {"mcl_core:dirt_with_dry_grass", "mcl_core:dirt_with_dry_grass_snow"}, action = function(pos, node) - local biome_data = minetest.get_biome_data(pos) - 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 - if node.name == "mcl_core:dirt_with_dry_grass_snow" then - node.name = "mcl_core:dirt_with_grass_snow" - else - node.name = "mcl_core:dirt_with_grass" - end - node.param2 = reg_biome._mcl_grass_palette_index - -- Fall back to savanna palette index - if not node.param2 then - node.param2 = SAVANNA_INDEX - end - minetest.set_node(pos, node) - return - end + if node.name == "mcl_core:dirt_with_dry_grass_snow" then + node.name = "mcl_core:dirt_with_grass_snow" + else + node.name = "mcl_core:dirt_with_grass" + end + -- use savanna palette index to simulate dry grass. + if not node.param2 then + node.param2 = SAVANNA_INDEX end - node.param2 = SAVANNA_INDEX minetest.set_node(pos, node) return end, From ec7a97ba3eb80de352696dd364b017d2d69d5dc5 Mon Sep 17 00:00:00 2001 From: Michieal Date: Mon, 6 Feb 2023 16:54:23 -0500 Subject: [PATCH 2/2] Made LBM run at every load, so that it catches anything missed from previous passes. --- mods/ITEMS/mcl_core/functions.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index 2fa8489e0..72ad9ad9a 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -927,6 +927,7 @@ minetest.register_lbm({ label = "Replace legacy dry grass", name = "mcl_core:replace_legacy_dry_grass_0_65_0", nodenames = {"mcl_core:dirt_with_dry_grass", "mcl_core:dirt_with_dry_grass_snow"}, + run_at_every_load = true, action = function(pos, node) if node.name == "mcl_core:dirt_with_dry_grass_snow" then node.name = "mcl_core:dirt_with_grass_snow"