Improve certain functions

This commit is contained in:
FossFanatic 2023-02-14 18:10:49 +00:00
parent 8fd40eaf46
commit bea9bbe212
1 changed files with 4 additions and 8 deletions

View File

@ -803,10 +803,8 @@ end
local grass_spread_randomizer = PseudoRandom(minetest.get_mapgen_setting("seed")) local grass_spread_randomizer = PseudoRandom(minetest.get_mapgen_setting("seed"))
function mcl_core.get_grass_palette_index(pos) function mcl_core.get_grass_palette_index(pos)
local reg_biome = mcl_util.get_registered_biome_from_pos(pos) local grass_palette_index = mcl_util.get_palette_indexes_from_pos(pos).grass_palette_index
if reg_biome and reg_biome._mcl_grass_palette_index then return grass_palette_index
return reg_biome._mcl_grass_palette_index
end
end end
-- Return appropriate grass block node for pos -- Return appropriate grass block node for pos
@ -815,10 +813,8 @@ function mcl_core.get_grass_block_type(pos)
end end
function mcl_core.get_foliage_palette_index(pos) function mcl_core.get_foliage_palette_index(pos)
local reg_biome = mcl_util.get_registered_biome_from_pos(pos) local foliage_palette_index = mcl_util.get_palette_indexes_from_pos(pos).foliage_palette_index
if reg_biome and reg_biome._mcl_foliage_palette_index then return foliage_palette_index
return reg_biome._mcl_foliage_palette_index
end
end end
-- Return appropriate foliage block node for pos -- Return appropriate foliage block node for pos