1
0
Fork 0

make conversion lbm a setting

lower_ow_mapgen
cora 2022-05-27 21:42:05 +02:00
parent 64fe5b34c6
commit 20ee4d3bdd
1 changed files with 22 additions and 18 deletions

View File

@ -30,6 +30,8 @@ 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)
-- 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)
mcl_vars.MAP_BLOCKSIZE = math.max(1, minetest.MAP_BLOCKSIZE or 16) mcl_vars.MAP_BLOCKSIZE = math.max(1, minetest.MAP_BLOCKSIZE or 16)
@ -265,21 +267,23 @@ function mcl_vars.get_node(p, force, us_timeout)
-- it still can return "ignore", LOL, even if force = true, but only after time out -- it still can return "ignore", LOL, even if force = true, but only after time out
end end
-- lbm to update from old mapgen depth to new. potentially affects a lot of nodes inducing lag.
if convert_old_bedrock then
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"}, nodenames = { "mcl_core:bedrock","mcl_core:void","mcl_core:barrier"},
run_at_every_load = false, run_at_every_load = false,
action = function(pos, node) action = function(p)
if if p.y >= mcl_vars.mg_overworld_min and
pos.y >= mcl_vars.mg_overworld_min + 20 and p.y <= mcl_vars.mg_overworld_min_old + 5 --
pos.y <= mcl_vars.mg_overworld_min_old + 10
then then
minetest.swap_node( if p.y <= mcl_vars.mg_bedrock_overworld_max and p.y >= mcl_vars.mg_bedrock_overworld_min then
pos, minetest.swap_node(p,{name="mcl_core:bedrock" }) --TODO: bedrock pattern
{ name="mcl_deepslate" } else
) minetest.swap_node(p,{name="mcl_deepslate:deepslate" })
end
end end
end, end,
}) })
end