mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-29 05:51:05 +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
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
function mcl_util.get_registered_biome_from_pos(pos)
|
function mcl_util.get_palette_indexes_from_pos(pos)
|
||||||
local mg_name = minetest.get_mapgen_setting("mg_name")
|
local palette_indexes = {grass_palette_index = 0, foliage_palette_index = 0}
|
||||||
if mg_name ~= "v6" and mg_name ~= "singlenode" then
|
local biome_data = minetest.get_biome_data(pos)
|
||||||
local biome_data = minetest.get_biome_data(pos)
|
local biome = biome_data.biome
|
||||||
local biome = biome_data.biome
|
local biome_name = minetest.get_biome_name(biome)
|
||||||
local biome_name = minetest.get_biome_name(biome)
|
local reg_biome = minetest.registered_biomes[biome_name]
|
||||||
local reg_biome = minetest.registered_biomes[biome_name]
|
if reg_biome then
|
||||||
return reg_biome
|
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
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue