forked from VoxeLibre/VoxeLibre
Enable biomes for lua mapgens using biomegen
This commit is contained in:
parent
d3fb221641
commit
813d669875
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue