1
0
Fork 0

Fix "mcl_core:dirt_with_dry_grass" to be "mcl_core:dirt_with_grass" with the savanna color index.

This commit is contained in:
Michieal 2023-02-05 21:17:53 -05:00
parent d454697953
commit de00b7228e
1 changed files with 8 additions and 20 deletions

View File

@ -928,29 +928,17 @@ minetest.register_lbm({
name = "mcl_core:replace_legacy_dry_grass_0_65_0", name = "mcl_core:replace_legacy_dry_grass_0_65_0",
nodenames = {"mcl_core:dirt_with_dry_grass", "mcl_core:dirt_with_dry_grass_snow"}, nodenames = {"mcl_core:dirt_with_dry_grass", "mcl_core:dirt_with_dry_grass_snow"},
action = function(pos, node) 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 if node.name == "mcl_core:dirt_with_dry_grass_snow" then
node.name = "mcl_core:dirt_with_grass_snow" node.name = "mcl_core:dirt_with_grass_snow"
else else
node.name = "mcl_core:dirt_with_grass" node.name = "mcl_core:dirt_with_grass"
end end
node.param2 = reg_biome._mcl_grass_palette_index -- use savanna palette index to simulate dry grass.
-- Fall back to savanna palette index
if not node.param2 then if not node.param2 then
node.param2 = SAVANNA_INDEX node.param2 = SAVANNA_INDEX
end end
minetest.set_node(pos, node) minetest.set_node(pos, node)
return return
end
end
node.param2 = SAVANNA_INDEX
minetest.set_node(pos, node)
return
end, end,
}) })