From 633d7a2fe1c3b66eab73e24abf3bec8129edf945 Mon Sep 17 00:00:00 2001 From: GNU Hacker Date: Thu, 6 Oct 2022 07:25:16 +0200 Subject: [PATCH] Make overworld_min configurable --- mods/CORE/mcl_init/init.lua | 4 +++- mods/CORE/mcl_worlds/init.lua | 14 +++++++------- mods/MAPGEN/mcl_biomes/init.lua | 1 - mods/MAPGEN/mcl_strongholds/init.lua | 2 +- settingtypes.txt | 3 +++ 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/mods/CORE/mcl_init/init.lua b/mods/CORE/mcl_init/init.lua index cd11ae1c3..731fd438b 100644 --- a/mods/CORE/mcl_init/init.lua +++ b/mods/CORE/mcl_init/init.lua @@ -101,8 +101,10 @@ if not superflat and not singlenode then ]] -- Overworld + local mg_overworld_min_default = -128 mcl_vars.mg_overworld_min_old = -62 - mcl_vars.mg_overworld_min = -128 + mcl_vars.mg_overworld_min = tonumber(minetest.settings:get("mcl_overworld_min")) or mg_overworld_min_default + mcl_vars.mg_overworld_max_official = mcl_vars.mg_overworld_min + minecraft_height_limit mcl_vars.mg_bedrock_overworld_min = mcl_vars.mg_overworld_min mcl_vars.mg_bedrock_overworld_max = mcl_vars.mg_bedrock_overworld_min + 4 diff --git a/mods/CORE/mcl_worlds/init.lua b/mods/CORE/mcl_worlds/init.lua index 9daedc5b4..efd2d80bc 100644 --- a/mods/CORE/mcl_worlds/init.lua +++ b/mods/CORE/mcl_worlds/init.lua @@ -61,13 +61,13 @@ local pos_to_dimension = mcl_worlds.pos_to_dimension -- MineClone 2. -- mc_dimension is one of "overworld", "nether", "end" (default: "overworld"). function mcl_worlds.layer_to_y(layer, mc_dimension) - if mc_dimension == "overworld" or mc_dimension == nil then - return layer + mcl_vars.mg_overworld_min_old - elseif mc_dimension == "nether" then - return layer + mcl_vars.mg_nether_min - elseif mc_dimension == "end" then - return layer + mcl_vars.mg_end_min - end + if mc_dimension == "overworld" or mc_dimension == nil then + return layer + mcl_vars.mg_overworld_min_old + elseif mc_dimension == "nether" then + return layer + mcl_vars.mg_nether_min + elseif mc_dimension == "end" then + return layer + mcl_vars.mg_end_min + end end -- Takes a position and returns true if this position can have weather diff --git a/mods/MAPGEN/mcl_biomes/init.lua b/mods/MAPGEN/mcl_biomes/init.lua index 2e3477450..6e4595869 100644 --- a/mods/MAPGEN/mcl_biomes/init.lua +++ b/mods/MAPGEN/mcl_biomes/init.lua @@ -1095,7 +1095,6 @@ local function register_biomes() _mcl_palette_index = 22, }) - -- Savanna minetest.register_biome({ name = "Savanna", diff --git a/mods/MAPGEN/mcl_strongholds/init.lua b/mods/MAPGEN/mcl_strongholds/init.lua index 2a362cc40..596a44e97 100644 --- a/mods/MAPGEN/mcl_strongholds/init.lua +++ b/mods/MAPGEN/mcl_strongholds/init.lua @@ -49,7 +49,7 @@ local function init_strongholds() if superflat then y = mcl_vars.mg_bedrock_overworld_max + 3 else - y = pr:next(mcl_vars.mg_bedrock_overworld_max+1, mcl_vars.mg_overworld_min+48) + y = pr:next(-50, -30) end local pos = { x = math.cos(angle) * dist, y = y, z = math.sin(angle) * dist } pos = vector.round(pos) diff --git a/settingtypes.txt b/settingtypes.txt index 7ab47e36d..caf966c54 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -136,6 +136,9 @@ mcl_default_shadow_intensity (Default shadow intensity) float 0.33 0.0 1.0 # See also: https://github.com/minetest/minetest/issues/95 mcl_translucent_ice (Translucent ice) bool false +# Overworld min deep (default: -128) +mcl_overworld_min (Overworld min deep) int -128 -25000 -62 + # Whether to generate fallen logs in some biomes. # They might not always look pretty and have strange overhangs. mcl_generate_fallen_logs (Generate fallen logs) bool false