Add LBM to fix MineClone2 <0.71 Nether roof void

Older versions of the MineClone2 map generator generated void nodes on
the Nether roof. These nodes prevented building there and allow players
to “chunktrail”, i.e. finding explored areas by going along old chunks.

This patch adds an LBM and a setting to activate it (default is false).

The LBM replaces void nodes on the Nether roof with air. This can cause
lag while the affected areas are being fixed. For this reason the LBM is
disabled by default. Note that the LBM is only useful if a world had the
Nether roof generated in MineClone2 <0.71; new worlds have no roof void.

There are probably better ways to fix the Nether roof, but this does
work and is a full solution to the problem, as the lag is temporary.
This commit is contained in:
Nils Dagsson Moskopp 2022-02-12 15:39:36 +01:00
parent a71e9d70c0
commit 5f5796330f
No known key found for this signature in database
GPG Key ID: A3BC671C35191080
2 changed files with 32 additions and 1 deletions

View File

@ -1,4 +1,9 @@
mcl_mapgen_core = {}
mcl_mapgen_core = {
replace_nether_roof_void_with_air = minetest.settings:get_bool(
"mcl_mapgen_core_replace_nether_roof_void_with_air",
false
)
}
mcl_mapgen_core.registered_generators = {}
local lvm, nodes, param2 = 0, 0, 0
@ -2296,3 +2301,24 @@ function mcl_mapgen_core.get_node(p, force, us_timeout)
return node
-- it still can return "ignore", LOL, even if force = true, but only after time out
end
if mcl_mapgen_core.replace_nether_roof_void_with_air then
minetest.register_lbm({
label = "Replace Nether roof void from MineClone2 <0.71 with air",
name = "mcl_mapgen_core:replace_nether_roof_void_with_air",
nodenames = { "mcl_core:void" },
run_at_every_load = false,
action = function(pos, node)
if (
pos.y >= mcl_vars.mg_bedrock_nether_top_max and
pos.y <= mcl_vars.mg_nether_max
) then
minetest.swap_node(
pos,
{ name="air" }
)
end
end,
})
end

View File

@ -152,3 +152,8 @@ basic_pseudobiome_villages (Enables very basic, and experimental "pseudobiome-ba
# If enabled, will run an LBM to fix the top 1/2 of double plants in mcimported worlds; defaults to true.
fix_doubleplants (Mcimport double plant fixes) bool true
# If enabled, will run an LBM to replace void nodes on the Nether roof generated by MineClone2 <0.71 with air.
# Activate this setting if you generated some Nether in MineClone2 <0.71 and want to build on the Nether roof.
# WARNING: This setting has quite poor performance and may lag Minetest while affected areas are being fixed.
mcl_mapgen_core_replace_nether_roof_void_with_air (Replace Nether roof void from MineClone2 <0.71 with air) bool false