Add experimental setting to disable superflat

This commit is contained in:
Wuzzy 2017-07-02 22:35:46 +02:00
parent b225ecf51f
commit 1db851b42b
3 changed files with 29 additions and 5 deletions

View file

@ -23,13 +23,17 @@ if mg_name ~= "flat" then
mcl_vars.mg_bedrock_is_rough = true mcl_vars.mg_bedrock_is_rough = true
else else
local ground = minetest.get_mapgen_setting("mgflat_ground_level") local ground = minetest.get_mapgen_setting("mgflat_ground_level")
ground = tonumber(ground)
if not ground then if not ground then
ground = 8 ground = 8
end end
mcl_vars.mg_overworld_min = ground - 3
mcl_vars.mg_overworld_max = mcl_vars.mg_overworld_min + minecraft_height_limit
-- 1 perfectly flat bedrock layer -- 1 perfectly flat bedrock layer
if minetest.get_mapgen_setting("mcl_superflat_classic") == "false" then
mcl_vars.mg_overworld_min = -30912
else
mcl_vars.mg_overworld_min = ground - 3
end
mcl_vars.mg_overworld_max = mcl_vars.mg_overworld_min + minecraft_height_limit
mcl_vars.mg_bedrock_overworld_min = mcl_vars.mg_overworld_min mcl_vars.mg_bedrock_overworld_min = mcl_vars.mg_overworld_min
mcl_vars.mg_bedrock_overworld_max = mcl_vars.mg_bedrock_overworld_min mcl_vars.mg_bedrock_overworld_max = mcl_vars.mg_bedrock_overworld_min
mcl_vars.mg_lava = false mcl_vars.mg_lava = false

View file

@ -883,8 +883,19 @@ if mg_name == "v6" then
register_mgv6_decorations() register_mgv6_decorations()
end end
if mg_name == "flat" then if mg_name == "flat" then
local classic = minetest.get_mapgen_setting("mcl_superflat_classic")
if classic == nil then
classic = minetest.settings:get_bool("mcl_superflat_classic")
minetest.set_mapgen_setting("mcl_superflat_classic", "true", true)
end
if classic ~= "false" then
-- Enforce superflat-like mapgen: No hills, lakes or caves
minetest.set_mapgen_setting("mg_flags", "nocaves,nodungeons,nodecorations,light", true) minetest.set_mapgen_setting("mg_flags", "nocaves,nodungeons,nodecorations,light", true)
minetest.set_mapgen_setting("mgflat_spflags", "nolakes,nohills", true) minetest.set_mapgen_setting("mgflat_spflags", "nolakes,nohills", true)
else
-- If superflat mode is disabled, mapgen is way more liberal
minetest.set_mapgen_setting("mg_flags", "caves,nodungeons,nodecorations,light", true)
end
else else
minetest.set_mapgen_setting("mg_flags", "caves,nodungeons,decorations,light", true) minetest.set_mapgen_setting("mg_flags", "caves,nodungeons,decorations,light", true)
end end

View file

@ -50,3 +50,12 @@ enable_bed_night_skip (Skip night when sleeping) bool true
# This setting is experimental and may be changed in later versions. # This setting is experimental and may be changed in later versions.
# Feedback is appreciated. # Feedback is appreciated.
craftguide_progressive_mode (EXPERIMENTAL: Enable recipe book progressive mode) bool true craftguide_progressive_mode (EXPERIMENTAL: Enable recipe book progressive mode) bool true
# If enabled, the “flat” map generator generates a “classic” superflat map:
# Completely flat, 1 layer of grass blocks on top of 2 layers of dirt on
# top of a final layer of bedrock.
# Note if this is enabled, the setting “mgflat_flags” is ignored. To
# customize the “flat” map generator, you must disable this setting.
# Warning: Disabling this setting is currently EXPERIMENTAL! The generated map
# may not be that pretty.
mcl_superflat_classic (Classic superflat map generation) bool true