1
0
Fork 0

Make mcl_spawn compatible with flat mapgen with superflat MCL2 option (but better to have some trees still)

This commit is contained in:
kay27 2021-02-03 16:08:00 +04:00
parent e8f8d4cb1e
commit 9492f276fc
1 changed files with 9 additions and 1 deletions

View File

@ -227,9 +227,17 @@ end
local function next_biome() local function next_biome()
if #biome_ids < 1 then if #biome_ids < 1 then
for _, biome_name in pairs(biomes_white_list) do for _, biome_name in pairs(biomes_white_list) do
table.insert(biome_ids, minetest.get_biome_id(biome_name)) local biome_id = minetest.get_biome_id(biome_name)
if biome_id then
table.insert(biome_ids, biome_id)
end end
end end
if #biome_ids < 1 then
minetest.log("warning", "[mcl_spawn] No suitable biomes found")
return false
end
minetest.log("action", "[mcl_spawn] Suitable biomes found: "..tostring(#biome_ids))
end
while check <= checks do while check <= checks do
local biome_data = minetest.get_biome_data(cp) local biome_data = minetest.get_biome_data(cp)
-- Sometimes biome_data is nil -- Sometimes biome_data is nil