enable deepslate generation

This commit is contained in:
cora 2022-05-27 21:42:37 +02:00
parent 20ee4d3bdd
commit b61641c0ca
1 changed files with 31 additions and 16 deletions

View File

@ -30,7 +30,7 @@ local minecraft_height_limit = 320
local superflat = mg_name == "flat" and minetest.get_mapgen_setting("mcl_superflat_classic") == "true" local superflat = mg_name == "flat" and minetest.get_mapgen_setting("mcl_superflat_classic") == "true"
local singlenode = mg_name == "singlenode" local singlenode = mg_name == "singlenode"
local convert_old_bedrock = minetest.settings:get_bool("convert_old_bedrock", true) local convert_old_bedrock = minetest.settings:get_bool("mcl_convert_old_bedrock", false)
-- Calculate mapgen_edge_min/mapgen_edge_max -- Calculate mapgen_edge_min/mapgen_edge_max
mcl_vars.chunksize = math.max(1, tonumber(minetest.get_mapgen_setting("chunksize")) or 5) mcl_vars.chunksize = math.max(1, tonumber(minetest.get_mapgen_setting("chunksize")) or 5)
@ -268,22 +268,37 @@ function mcl_vars.get_node(p, force, us_timeout)
end end
-- lbm to update from old mapgen depth to new. potentially affects a lot of nodes inducing lag. -- lbm to update from old mapgen depth to new. potentially affects a lot of nodes inducing lag.
if convert_old_bedrock then -- Also it will not generate ores or bedrock pattern.
local function register_lbms()
minetest.register_lbm({ minetest.register_lbm({
label = "Replace bedrock from old bedrock layer and air/void below to deepslate", label = "Replace bedrock from old bedrock layer and air/void below to deepslate",
name = ":mcl_mapgen_core:replace_old_bedrock", name = ":mcl_mapgen_core:replace_old_bedrock",
nodenames = { "mcl_core:bedrock","mcl_core:void","mcl_core:barrier"}, nodenames = { "mcl_core:bedrock" },
run_at_every_load = false, run_at_every_load = true,
action = function(p) action = function(p)
if p.y >= mcl_vars.mg_overworld_min and if p.y >= mcl_vars.mg_overworld_min_old - 1 and p.y <= mcl_vars.mg_overworld_min_old + 5 then
p.y <= mcl_vars.mg_overworld_min_old + 5 -- minetest.swap_node(p,{name="mcl_deepslate:deepslate"})
then end
--minetest.log("bedrock")
end
})
minetest.register_lbm({
label = "Replace bedrock from old bedrock layer and air/void below to deepslate",
name = ":mcl_mapgen_core:replace_old_void",
nodenames = { "mcl_core:void" },
run_at_every_load = true,
action = function(p)
if p.y <= mcl_vars.mg_overworld_min_old and p.y >= mcl_vars.mg_bedrock_overworld_min then
if p.y <= mcl_vars.mg_bedrock_overworld_max and p.y >= mcl_vars.mg_bedrock_overworld_min then if p.y <= mcl_vars.mg_bedrock_overworld_max and p.y >= mcl_vars.mg_bedrock_overworld_min then
minetest.swap_node(p,{name="mcl_core:bedrock" }) --TODO: bedrock pattern minetest.swap_node(p,{name="mcl_core:bedrock" })
else else
minetest.swap_node(p,{name="mcl_deepslate:deepslate" }) minetest.swap_node(p,{name="mcl_deepslate:deepslate"})
end end
end end
end, --minetest.log("void")
end
}) })
end end
if convert_old_bedrock then
register_lbms()
end