From b4e84dadb0429fbe13703a9d09cb7551ee33288c Mon Sep 17 00:00:00 2001 From: FossFanatic Date: Sun, 12 Feb 2023 07:57:04 +0000 Subject: [PATCH] Add new function Adds the `get_registered_biome_from_pos` function, which does what the name says. --- mods/CORE/mcl_util/init.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mods/CORE/mcl_util/init.lua b/mods/CORE/mcl_util/init.lua index f37b34444..13da7e78b 100644 --- a/mods/CORE/mcl_util/init.lua +++ b/mods/CORE/mcl_util/init.lua @@ -1011,3 +1011,13 @@ function mcl_util.check_position_protection(position, player) return false end + +function mcl_util.get_registered_biome_from_pos(pos) + if mg_name ~= "v6" and mg_name ~= "singlenode" then + 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] + return reg_biome + end +end