Enable biomes for lua mapgens using biomegen

This commit is contained in:
Sebastian Riedel 2023-08-18 13:35:06 +02:00
parent d3fb221641
commit 813d669875
1 changed files with 16 additions and 13 deletions

View File

@ -6056,7 +6056,7 @@ end
--
-- Detect mapgen to select functions
--
if mg_name ~= "singlenode" then
if mg_name ~= "singlenode" or minetest.get_modpath("biomegen") then
if not superflat then
if mg_name ~= "v6" then
register_biomes()
@ -6154,19 +6154,22 @@ if mg_name ~= "singlenode" then
if not (maxp.y < mcl_vars.mg_overworld_min or minp.y > mcl_vars.mg_overworld_max) then
local biomemap = minetest.get_mapgen_object("biomemap")
--minetest.log("mangrove stuff: " .. dump(biomemap))
local swamp_biome_id = minetest.get_biome_id("MangroveSwamp")
local swamp_shore_id = minetest.get_biome_id("MangroveSwamp_shore")
local is_swamp = table.indexof(biomemap, swamp_biome_id) ~= -1
local is_swamp_shore = table.indexof(biomemap, swamp_shore_id) ~= -1
-- get_mapgen_object returns nil with lua mapgens
if biomemap then
--minetest.log("mangrove stuff: " .. dump(biomemap))
local swamp_biome_id = minetest.get_biome_id("MangroveSwamp")
local swamp_shore_id = minetest.get_biome_id("MangroveSwamp_shore")
local is_swamp = table.indexof(biomemap, swamp_biome_id) ~= -1
local is_swamp_shore = table.indexof(biomemap, swamp_shore_id) ~= -1
if is_swamp or is_swamp_shore then
--minetest.log("Mangrove swamp biomes...")
--minetest.log("is_swamp: " .. dump(is_swamp))
--minetest.log("is_swamp_shore: " .. dump(is_swamp_shore))
mangrove_roots_gen(gennotify, pr)
else
--minetest.log("is not mangrove swamp biomes...")
if is_swamp or is_swamp_shore then
--minetest.log("Mangrove swamp biomes...")
--minetest.log("is_swamp: " .. dump(is_swamp))
--minetest.log("is_swamp_shore: " .. dump(is_swamp_shore))
mangrove_roots_gen(gennotify, pr)
else
--minetest.log("is not mangrove swamp biomes...")
end
end
end