diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index c03d9d66e1..ef35bc5497 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -803,7 +803,12 @@ end local grass_spread_randomizer = PseudoRandom(minetest.get_mapgen_setting("seed")) function mcl_core.get_grass_palette_index(pos) - return mcl_util.get_registered_biome_from_pos(pos)._mcl_grass_palette_index + local reg_biome = mcl_util.get_registered_biome_from_pos(pos) + if reg_biome and reg_biome._mcl_grass_palette_index then + return reg_biome._mcl_grass_palette_index + else + return index + end end -- Return appropriate grass block node for pos @@ -812,7 +817,12 @@ function mcl_core.get_grass_block_type(pos) end function mcl_core.get_foliage_palette_index(pos) - return mcl_util.get_registered_biome_from_pos(pos)._mcl_foliage_palette_index + local reg_biome = mcl_util.get_registered_biome_from_pos(pos) + if reg_biome and reg_biome._mcl_foliage_palette_index then + return reg_biome._mcl_foliage_palette_index + else + return index + end end -- Return appropriate foliage block node for pos