mapgen surface and underground types

This commit is contained in:
BuckarooBanzay 2022-11-10 08:58:48 +01:00
parent 5bc7481487
commit e363dfe9f6

View File

@ -103,7 +103,7 @@ function building_lib.create_mapgen(opts)
return mapblock_pos.y == opts.water_level and height <= mapblock_pos.y return mapblock_pos.y == opts.water_level and height <= mapblock_pos.y
end end
return function(minp, maxp) local function on_generated(minp, maxp)
local min_mapblock = mapblock_lib.get_mapblock(minp) local min_mapblock = mapblock_lib.get_mapblock(minp)
local max_mapblock = mapblock_lib.get_mapblock(maxp) local max_mapblock = mapblock_lib.get_mapblock(maxp)
@ -131,15 +131,15 @@ function building_lib.create_mapgen(opts)
-- nothing above, place water building -- nothing above, place water building
building_lib.build_mapgen(mapblock_pos, biome.buildings.water, 0) building_lib.build_mapgen(mapblock_pos, biome.buildings.water, 0)
elseif mapblock_pos.y < height then elseif mapblock_pos.y < height then
-- subsurface -- underground
building_lib.build_mapgen(mapblock_pos, biome.buildings.full, 0) building_lib.build_mapgen(mapblock_pos, biome.buildings.underground, 0)
elseif mapblock_pos.y == height then elseif mapblock_pos.y == height then
-- surface -- surface
-- check if neighbors are lower -- check if neighbors are lower
local hm = get_height_map(mapblock_pos, height) local hm = get_height_map(mapblock_pos, height)
local building_name = biome.buildings.full local building_name = biome.buildings.surface
local rotation = 0 local rotation = 0
-- normal slopes -- normal slopes
@ -188,7 +188,10 @@ function building_lib.create_mapgen(opts)
end --z end --z
end --y end --y
end --x end --x
end, { end
return {
on_generated = on_generated,
get_height = get_height, get_height = get_height,
get_temperature_humidity = get_temperature_humidity, get_temperature_humidity = get_temperature_humidity,
get_biome = function(mapblock_pos) get_biome = function(mapblock_pos)