From 406b27852b3e85b8989754dfb3b7d6c5b422ce78 Mon Sep 17 00:00:00 2001 From: FossFanatic Date: Thu, 16 Feb 2023 07:54:00 +0000 Subject: [PATCH] Improve the new function somewhat --- mods/CORE/mcl_util/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/CORE/mcl_util/init.lua b/mods/CORE/mcl_util/init.lua index 4889b7d0a8..3c755da22c 100644 --- a/mods/CORE/mcl_util/init.lua +++ b/mods/CORE/mcl_util/init.lua @@ -1017,13 +1017,13 @@ function mcl_util.check_position_protection(position, player) return false end +local palette_indexes = {grass_palette_index = 0, foliage_palette_index = 0} function mcl_util.get_palette_indexes_from_pos(pos) - local palette_indexes = {grass_palette_index = 0, foliage_palette_index = 0} local biome_data = minetest.get_biome_data(pos) 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 reg_biome and reg_biome._mcl_grass_palette_index and reg_biome._mcl_foliage_palette_index then local gpi = reg_biome._mcl_grass_palette_index local fpi = reg_biome._mcl_foliage_palette_index local palette_indexes = {grass_palette_index = gpi, foliage_palette_index = fpi}