mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-25 20:11:06 +01:00
Replace get_registered_biome_from_pos with get_palette_indexes_from_pos
This commit is contained in:
parent
fcaa2c4ce1
commit
8fd40eaf46
1 changed files with 13 additions and 8 deletions
|
@ -1017,13 +1017,18 @@ function mcl_util.check_position_protection(position, player)
|
|||
return false
|
||||
end
|
||||
|
||||
function mcl_util.get_registered_biome_from_pos(pos)
|
||||
local mg_name = minetest.get_mapgen_setting("mg_name")
|
||||
if mg_name ~= "v6" and mg_name ~= "singlenode" then
|
||||
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]
|
||||
return reg_biome
|
||||
if reg_biome 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}
|
||||
return palette_indexes
|
||||
else
|
||||
return palette_indexes
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue