mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 18:41:09 +01:00
Merge pull request 'Fix "mcl_core:dirt_with_dry_grass" to be "mcl_core:dirt_with_grass" with the savanna color index.' (#3408) from fix_dirt_dry_grass into master
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/3408 Reviewed-by: ancientmarinerdev <ancientmariner_dev@proton.me>
This commit is contained in:
commit
3c13ce1d6b
1 changed files with 9 additions and 20 deletions
|
@ -927,28 +927,17 @@ minetest.register_lbm({
|
||||||
label = "Replace legacy dry grass",
|
label = "Replace legacy dry grass",
|
||||||
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"},
|
||||||
|
run_at_every_load = true,
|
||||||
action = function(pos, node)
|
action = function(pos, node)
|
||||||
local biome_data = minetest.get_biome_data(pos)
|
if node.name == "mcl_core:dirt_with_dry_grass_snow" then
|
||||||
if biome_data then
|
node.name = "mcl_core:dirt_with_grass_snow"
|
||||||
local biome = biome_data.biome
|
else
|
||||||
local biome_name = minetest.get_biome_name(biome)
|
node.name = "mcl_core:dirt_with_grass"
|
||||||
local reg_biome = minetest.registered_biomes[biome_name]
|
end
|
||||||
if reg_biome then
|
-- use savanna palette index to simulate dry grass.
|
||||||
if node.name == "mcl_core:dirt_with_dry_grass_snow" then
|
if not node.param2 then
|
||||||
node.name = "mcl_core:dirt_with_grass_snow"
|
node.param2 = SAVANNA_INDEX
|
||||||
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
|
|
||||||
end
|
end
|
||||||
node.param2 = SAVANNA_INDEX
|
|
||||||
minetest.set_node(pos, node)
|
minetest.set_node(pos, node)
|
||||||
return
|
return
|
||||||
end,
|
end,
|
||||||
|
|
Loading…
Reference in a new issue