mirror of
https://github.com/FaceDeer/dfcaverns.git
synced 2025-01-12 03:00:26 +01:00
more fixes for overgen support
This commit is contained in:
parent
b29f549d76
commit
816f0bf7eb
@ -96,8 +96,9 @@ local decorate_level_1 = function(minp, maxp, seed, vm, node_arrays, area, data)
|
|||||||
|
|
||||||
-- Partly fill flooded caverns and warrens
|
-- Partly fill flooded caverns and warrens
|
||||||
if minp.y <= subsea_level then
|
if minp.y <= subsea_level then
|
||||||
for vi in area:iterp(minp, maxp) do
|
for vi, x, y, z in area:iterp_yxz(area.MinEdge, area.MaxEdge) do
|
||||||
if data[vi] == c_air and area:get_y(vi) <= subsea_level and nvals_cave[vi] < -flooding_threshold then
|
-- convert all air below sea level into water
|
||||||
|
if y <= subsea_level and data[vi] == c_air and nvals_cave[vi] < -flooding_threshold then
|
||||||
data[vi] = c_water
|
data[vi] = c_water
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -138,7 +138,7 @@ local decorate_level_2 = function(minp, maxp, seed, vm, node_arrays, area, data)
|
|||||||
local vein_area
|
local vein_area
|
||||||
|
|
||||||
-- Partly fill flooded caverns and warrens
|
-- Partly fill flooded caverns and warrens
|
||||||
for vi in area:iterp(minp, maxp) do
|
for vi, x, y, z in area:iterp_yxz(area.MinEdge, area.MaxEdge) do
|
||||||
local cave_val = nvals_cave[vi]
|
local cave_val = nvals_cave[vi]
|
||||||
if cave_val < -flooding_threshold then
|
if cave_val < -flooding_threshold then
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ local decorate_level_2 = function(minp, maxp, seed, vm, node_arrays, area, data)
|
|||||||
data[vi] = c_veinstone
|
data[vi] = c_veinstone
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if data[vi] == c_air and area:get_y(vi) <= subsea_level then
|
if data[vi] == c_air and y <= subsea_level then
|
||||||
data[vi] = c_water -- otherwise, fill air with water when below sea level
|
data[vi] = c_water -- otherwise, fill air with water when below sea level
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -207,16 +207,15 @@ local decorate_level_3 = function(minp, maxp, seed, vm, node_arrays, area, data)
|
|||||||
|
|
||||||
-- Partly fill flooded caverns and warrens
|
-- Partly fill flooded caverns and warrens
|
||||||
if minp.y <= subsea_level then
|
if minp.y <= subsea_level then
|
||||||
for vi in area:iterp(minp, maxp) do
|
for vi, x, y, z in area:iterp_yxz(area.MinEdge, area.MaxEdge) do
|
||||||
local y = area:get_y(vi)
|
|
||||||
if y <= subsea_level and nvals_cave[vi] < -flooding_threshold then
|
if y <= subsea_level and nvals_cave[vi] < -flooding_threshold then
|
||||||
if data[vi] == c_air and y <= subsea_level then
|
if data[vi] == c_air and y <= subsea_level then
|
||||||
data[vi] = c_water
|
data[vi] = c_water
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if (mapgen_helper.is_pos_within_box({x=x, y=y, z=z}, minp, maxp)) then
|
||||||
local index2d = mapgen_helper.index2di(minp, maxp, area, vi)
|
local index2d = mapgen_helper.index2di(minp, maxp, area, vi)
|
||||||
local biome_name = get_biome(heatmap[index2d], humiditymap[index2d])
|
local biome_name = get_biome(heatmap[index2d], humiditymap[index2d])
|
||||||
|
|
||||||
if biome_name == "blackcap" then
|
if biome_name == "blackcap" then
|
||||||
-- oil slick
|
-- oil slick
|
||||||
local cave = math.abs(nvals_cave[vi])
|
local cave = math.abs(nvals_cave[vi])
|
||||||
@ -230,6 +229,7 @@ local decorate_level_3 = function(minp, maxp, seed, vm, node_arrays, area, data)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
-- Cavern floors
|
-- Cavern floors
|
||||||
|
@ -221,7 +221,6 @@ local dfcaverns_mods = {
|
|||||||
"df_underworld_items:",
|
"df_underworld_items:",
|
||||||
"ice_sprites:",
|
"ice_sprites:",
|
||||||
"mine_gas:",
|
"mine_gas:",
|
||||||
"default:water",
|
|
||||||
}
|
}
|
||||||
df_caverns.is_ground_content = function(c_node)
|
df_caverns.is_ground_content = function(c_node)
|
||||||
if dfcaverns_nodes then
|
if dfcaverns_nodes then
|
||||||
|
@ -223,12 +223,17 @@ local decorate_sunless_sea = function(minp, maxp, seed, vm, node_arrays, area, d
|
|||||||
data[vi] = c_obsidian
|
data[vi] = c_obsidian
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
skip_next = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if minp.y <= sea_level then
|
||||||
|
for vi, x, y, z in area:iterp_yxz(area.MinEdge, area.MaxEdge) do
|
||||||
-- convert all air below sea level into water
|
-- convert all air below sea level into water
|
||||||
if y <= sea_level and data[vi] == c_air then
|
if y <= sea_level and data[vi] == c_air then
|
||||||
data[vi] = c_water
|
data[vi] = c_water
|
||||||
end
|
end
|
||||||
else
|
|
||||||
skip_next = false
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -120,6 +120,7 @@ minetest.register_node("df_primordial_items:jungle_mushroom_sapling", {
|
|||||||
local c_stem = minetest.get_content_id("df_primordial_items:jungle_mushroom_trunk")
|
local c_stem = minetest.get_content_id("df_primordial_items:jungle_mushroom_trunk")
|
||||||
local c_cap_1 = minetest.get_content_id("df_primordial_items:jungle_mushroom_cap_1")
|
local c_cap_1 = minetest.get_content_id("df_primordial_items:jungle_mushroom_cap_1")
|
||||||
local c_cap_2 = minetest.get_content_id("df_primordial_items:jungle_mushroom_cap_2")
|
local c_cap_2 = minetest.get_content_id("df_primordial_items:jungle_mushroom_cap_2")
|
||||||
|
local c_air = minetest.get_content_id("air")
|
||||||
|
|
||||||
df_primordial_items.spawn_jungle_mushroom = function(pos)
|
df_primordial_items.spawn_jungle_mushroom = function(pos)
|
||||||
local x, y, z = pos.x, pos.y, pos.z
|
local x, y, z = pos.x, pos.y, pos.z
|
||||||
@ -142,7 +143,7 @@ df_primordial_items.spawn_jungle_mushroom = function(pos)
|
|||||||
local area = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
|
local area = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
|
||||||
local data = vm:get_data()
|
local data = vm:get_data()
|
||||||
|
|
||||||
subterrane.giant_mushroom(area:indexp(pos), area, data, c_stem, c_cap, nil, stem_height, cap_radius)
|
subterrane.giant_mushroom(area:indexp(pos), area, data, c_stem, c_cap, c_air, stem_height, cap_radius)
|
||||||
|
|
||||||
vm:set_data(data)
|
vm:set_data(data)
|
||||||
vm:write_to_map()
|
vm:write_to_map()
|
||||||
@ -158,5 +159,5 @@ df_primordial_items.spawn_jungle_mushroom_vm = function(vi, area, data)
|
|||||||
else
|
else
|
||||||
c_cap = c_cap_2
|
c_cap = c_cap_2
|
||||||
end
|
end
|
||||||
subterrane.giant_mushroom(vi, area, data, c_stem, c_cap, nil, stem_height, cap_radius)
|
subterrane.giant_mushroom(vi, area, data, c_stem, c_cap, c_air, stem_height, cap_radius)
|
||||||
end
|
end
|
Loading…
Reference in New Issue
Block a user