forked from MineClone5/MineClone5
New lava generator: Spawn in air in layers 1-10
This commit is contained in:
parent
d13fe532c5
commit
ef06d345df
|
@ -18,6 +18,8 @@ if mg_name ~= "flat" then
|
|||
-- 1 flat bedrock layer with 4 rough layers above
|
||||
mcl_vars.mg_bedrock_overworld_min = mcl_vars.mg_overworld_min
|
||||
mcl_vars.mg_bedrock_overworld_max = mcl_vars.mg_bedrock_overworld_min + 4
|
||||
mcl_vars.mg_lava_overworld_max = mcl_vars.mg_overworld_min + 10
|
||||
mcl_vars.mg_lava = true
|
||||
mcl_vars.mg_bedrock_is_rough = true
|
||||
else
|
||||
local ground = minetest.get_mapgen_setting("mgflat_ground_level")
|
||||
|
@ -30,6 +32,7 @@ else
|
|||
-- 1 perfectly flat bedrock layer
|
||||
mcl_vars.mg_bedrock_overworld_min = mcl_vars.mg_overworld_min - 2
|
||||
mcl_vars.mg_bedrock_overworld_max = mcl_vars.mg_bedrock_overworld_min
|
||||
mcl_vars.mg_lava = false
|
||||
mcl_vars.mg_bedrock_is_rough = false
|
||||
end
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ minetest.register_alias("mapgen_dirt_with_snow", "mcl_core:dirt_with_grass_snow"
|
|||
minetest.register_alias("mapgen_sand", "mcl_core:sand")
|
||||
minetest.register_alias("mapgen_gravel", "mcl_core:gravel")
|
||||
minetest.register_alias("mapgen_clay", "mcl_core:clay")
|
||||
minetest.register_alias("mapgen_lava_source", "mcl_core:lava_source")
|
||||
minetest.register_alias("mapgen_lava_source", "air") -- Built-in lava generator is too unpredictable, we generate lava on our own
|
||||
minetest.register_alias("mapgen_cobble", "mcl_core:cobble")
|
||||
minetest.register_alias("mapgen_mossycobble", "mcl_core:mossycobble")
|
||||
minetest.register_alias("mapgen_junglegrass", "mcl_flowers:fern")
|
||||
|
@ -521,7 +521,7 @@ minetest.register_ore({
|
|||
ore_type = "scatter",
|
||||
ore = "mcl_core:lava_source",
|
||||
wherein = stonelike,
|
||||
clust_scarcity = 4000,
|
||||
clust_scarcity = 2000,
|
||||
clust_num_ores = 1,
|
||||
clust_size = 1,
|
||||
y_min = mcl_util.layer_to_y(1),
|
||||
|
@ -980,6 +980,7 @@ end)
|
|||
-- Generate bedrock layer or layers
|
||||
local BEDROCK_MIN = mcl_vars.mg_bedrock_overworld_min
|
||||
local BEDROCK_MAX = mcl_vars.mg_bedrock_overworld_max
|
||||
local GEN_MAX = mcl_vars.mg_lava_overworld_max or BEDROCK_MAX
|
||||
|
||||
-- Buffer for LuaVoxelManip
|
||||
local lvm_buffer = {}
|
||||
|
@ -991,12 +992,14 @@ minetest.register_on_generated(function(minp, maxp)
|
|||
local area = VoxelArea:new({MinEdge=emin, MaxEdge=emax})
|
||||
local lvm_used = false
|
||||
|
||||
-- Generate bedrock layers
|
||||
if minp.y <= BEDROCK_MAX then
|
||||
-- Generate bedrock and lava layers
|
||||
if minp.y <= GEN_MAX then
|
||||
local c_bedrock = minetest.get_content_id("mcl_core:bedrock")
|
||||
local c_void = minetest.get_content_id("mcl_core:void")
|
||||
local c_lava = minetest.get_content_id("mcl_core:lava_source")
|
||||
local c_air = minetest.get_content_id("air")
|
||||
|
||||
local max_y = math.min(maxp.y, BEDROCK_MAX)
|
||||
local max_y = math.min(maxp.y, GEN_MAX)
|
||||
|
||||
for y = minp.y, max_y do
|
||||
for x = minp.x, maxp.x do
|
||||
|
@ -1036,6 +1039,11 @@ minetest.register_on_generated(function(minp, maxp)
|
|||
if setdata then
|
||||
data[p_pos] = setdata
|
||||
lvm_used = true
|
||||
elseif mcl_vars.mg_lava and y <= mcl_vars.mg_lava_overworld_max then
|
||||
if data[p_pos] == c_air then
|
||||
data[p_pos] = c_lava
|
||||
end
|
||||
lvm_used = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -73,7 +73,12 @@ if setting then
|
|||
end
|
||||
|
||||
-- Max. and min. heights between rail corridors are generated
|
||||
local height_min = mcl_vars.mg_bedrock_overworld_max + 5 -- FIXME: Above lava layers
|
||||
local height_min
|
||||
if mcl_vars.mg_lava then
|
||||
height_min = mcl_vars.mg_lava_overworld_max + 2
|
||||
else
|
||||
height_min = mcl_vars.mg_bedrock_overworld_max + 2
|
||||
end
|
||||
local height_max = mcl_util.layer_to_y(60)
|
||||
|
||||
-- Chaos Mode: If enabled, rail corridors don't stop generating when hitting obstacles
|
||||
|
@ -567,9 +572,9 @@ minetest.register_on_generated(function(minp, maxp, blockseed)
|
|||
if minp.y < height_max and maxp.y > height_min and pr:next() < probability_railcaves_in_chunk then
|
||||
-- Get semi-random height in chunk
|
||||
|
||||
local buffer = 5
|
||||
local y = pr:next(minp.y + buffer, maxp.y - buffer)
|
||||
y = math.floor(math.max(height_min, math.min(height_max, y)))
|
||||
local buffer = 4
|
||||
local y = pr:next(minp.y, maxp.y)
|
||||
y = math.floor(math.max(height_min + buffer, math.min(height_max - buffer, y)))
|
||||
local p = {x=minp.x+(maxp.x-minp.x)/2, y=y, z=minp.z+(maxp.z-minp.z)/2}
|
||||
-- Haupthöhle und alle weiteren
|
||||
-- Corridors; starting with main cave out of dirt
|
||||
|
|
Loading…
Reference in New Issue