Skip to content

Commit

Permalink
Remove Mapgen V7 floatland biome code
Browse files Browse the repository at this point in the history
In preparation for a new Mapgen V7 floatland implementation.
  • Loading branch information
paramat committed Dec 18, 2019
1 parent d04b709 commit 150122b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 104 deletions.
2 changes: 1 addition & 1 deletion mods/butterflies/init.lua
Expand Up @@ -102,7 +102,7 @@ minetest.register_decoration({
place_offset_y = 2,
sidelen = 80,
fill_ratio = 0.005,
biomes = {"grassland", "deciduous_forest", "floatland_grassland"},
biomes = {"grassland", "deciduous_forest"},
y_max = 31000,
y_min = 1,
decoration = {
Expand Down
122 changes: 22 additions & 100 deletions mods/default/mapgen.lua
Expand Up @@ -576,7 +576,7 @@ function default.register_ores()
-- Only where default:dirt is present as surface material
biomes = {"taiga", "snowy_grassland", "grassland", "coniferous_forest",
"deciduous_forest", "deciduous_forest_shore", "rainforest",
"rainforest_swamp", "floatland_coniferous_forest"}
"rainforest_swamp"}
})

-- Gravel
Expand Down Expand Up @@ -890,7 +890,7 @@ end

-- All mapgens except mgv6

function default.register_biomes(upper_limit)
function default.register_biomes()

-- Icesheet

Expand All @@ -909,7 +909,7 @@ function default.register_biomes(upper_limit)
depth_riverbed = 2,
node_dungeon = "default:ice",
node_dungeon_stair = "stairs:stair_ice",
y_max = upper_limit,
y_max = 31000,
y_min = -8,
heat_point = 0,
humidity_point = 73,
Expand Down Expand Up @@ -956,7 +956,7 @@ function default.register_biomes(upper_limit)
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = upper_limit,
y_max = 31000,
y_min = 47,
heat_point = 0,
humidity_point = 40,
Expand Down Expand Up @@ -1043,7 +1043,7 @@ function default.register_biomes(upper_limit)
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = upper_limit,
y_max = 31000,
y_min = 4,
heat_point = 25,
humidity_point = 70,
Expand Down Expand Up @@ -1095,7 +1095,7 @@ function default.register_biomes(upper_limit)
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = upper_limit,
y_max = 31000,
y_min = 4,
heat_point = 20,
humidity_point = 35,
Expand Down Expand Up @@ -1146,7 +1146,7 @@ function default.register_biomes(upper_limit)
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = upper_limit,
y_max = 31000,
y_min = 6,
heat_point = 50,
humidity_point = 35,
Expand Down Expand Up @@ -1213,7 +1213,7 @@ function default.register_biomes(upper_limit)
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = upper_limit,
y_max = 31000,
y_min = 6,
heat_point = 45,
humidity_point = 70,
Expand Down Expand Up @@ -1280,7 +1280,7 @@ function default.register_biomes(upper_limit)
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = upper_limit,
y_max = 31000,
y_min = 1,
heat_point = 60,
humidity_point = 68,
Expand Down Expand Up @@ -1347,7 +1347,7 @@ function default.register_biomes(upper_limit)
depth_riverbed = 2,
node_dungeon = "default:desert_stone",
node_dungeon_stair = "stairs:stair_desert_stone",
y_max = upper_limit,
y_max = 31000,
y_min = 4,
heat_point = 92,
humidity_point = 16,
Expand Down Expand Up @@ -1397,7 +1397,7 @@ function default.register_biomes(upper_limit)
depth_riverbed = 2,
node_dungeon = "default:sandstonebrick",
node_dungeon_stair = "stairs:stair_sandstone_block",
y_max = upper_limit,
y_max = 31000,
y_min = 4,
heat_point = 60,
humidity_point = 0,
Expand Down Expand Up @@ -1446,7 +1446,7 @@ function default.register_biomes(upper_limit)
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = upper_limit,
y_max = 31000,
y_min = 4,
heat_point = 40,
humidity_point = 0,
Expand Down Expand Up @@ -1496,7 +1496,7 @@ function default.register_biomes(upper_limit)
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = upper_limit,
y_max = 31000,
y_min = 1,
heat_point = 89,
humidity_point = 42,
Expand Down Expand Up @@ -1563,7 +1563,7 @@ function default.register_biomes(upper_limit)
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = upper_limit,
y_max = 31000,
y_min = 1,
heat_point = 86,
humidity_point = 65,
Expand Down Expand Up @@ -1619,59 +1619,6 @@ function default.register_biomes(upper_limit)
end


-- Biomes for floatlands

-- TODO Temporary simple biomes to be replaced by special floatland biomes later.

function default.register_floatland_biomes(floatland_level, shadow_limit)

minetest.register_biome({
name = "floatland_grassland",
node_top = "default:dirt_with_grass",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 1,
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = 31000,
y_min = floatland_level + 2,
heat_point = 50,
humidity_point = 25,
})

minetest.register_biome({
name = "floatland_coniferous_forest",
node_top = "default:dirt_with_coniferous_litter",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 3,
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = 31000,
y_min = floatland_level + 2,
heat_point = 50,
humidity_point = 75,
})

minetest.register_biome({
name = "floatland_ocean",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 3,
node_dungeon = "default:cobble",
node_dungeon_alt = "default:mossycobble",
node_dungeon_stair = "stairs:stair_cobble",
y_max = floatland_level + 1,
y_min = shadow_limit,
heat_point = 50,
humidity_point = 50,
})
end


--
-- Register decorations
--
Expand Down Expand Up @@ -1787,7 +1734,7 @@ local function register_grass_decoration(offset, scale, length)
octaves = 3,
persist = 0.6
},
biomes = {"grassland", "deciduous_forest", "floatland_grassland"},
biomes = {"grassland", "deciduous_forest"},
y_max = 31000,
y_min = 1,
decoration = "default:grass_" .. length,
Expand Down Expand Up @@ -1829,7 +1776,7 @@ local function register_fern_decoration(seed, length)
octaves = 3,
persist = 0.7
},
biomes = {"coniferous_forest", "floatland_coniferous_forest"},
biomes = {"coniferous_forest"},
y_max = 31000,
y_min = 6,
decoration = "default:fern_" .. length,
Expand Down Expand Up @@ -2011,7 +1958,7 @@ function default.register_decorations()
octaves = 3,
persist = 0.66
},
biomes = {"taiga", "coniferous_forest", "floatland_coniferous_forest"},
biomes = {"taiga", "coniferous_forest"},
y_max = 31000,
y_min = 4,
schematic = minetest.get_modpath("default") .. "/schematics/pine_tree.mts",
Expand All @@ -2031,7 +1978,7 @@ function default.register_decorations()
octaves = 3,
persist = 0.66
},
biomes = {"taiga", "coniferous_forest", "floatland_coniferous_forest"},
biomes = {"taiga", "coniferous_forest"},
y_max = 31000,
y_min = 4,
schematic = minetest.get_modpath("default") .. "/schematics/small_pine_tree.mts",
Expand All @@ -2045,7 +1992,7 @@ function default.register_decorations()
place_offset_y = 1,
sidelen = 80,
fill_ratio = 0.0018,
biomes = {"taiga", "coniferous_forest", "floatland_coniferous_forest"},
biomes = {"taiga", "coniferous_forest"},
y_max = 31000,
y_min = 4,
schematic = minetest.get_modpath("default") .. "/schematics/pine_log.mts",
Expand Down Expand Up @@ -2230,8 +2177,7 @@ function default.register_decorations()
octaves = 3,
persist = 0.7,
},
biomes = {"grassland", "deciduous_forest",
"floatland_grassland"},
biomes = {"grassland", "deciduous_forest"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("default") .. "/schematics/bush.mts",
Expand Down Expand Up @@ -2503,22 +2449,9 @@ end


--
-- Detect mapgen, flags and parameters to select functions
-- Detect mapgen to select functions
--

-- Get setting or default
local mgv7_spflags = minetest.get_mapgen_setting("mgv7_spflags") or
"mountains, ridges, nofloatlands, caverns"
local captures_float = string.match(mgv7_spflags, "floatlands")
local captures_nofloat = string.match(mgv7_spflags, "nofloatlands")

-- Get setting or default
-- Make global for mods to use to register floatland biomes
default.mgv7_floatland_level =
minetest.get_mapgen_setting("mgv7_floatland_level") or 1280
default.mgv7_shadow_limit =
minetest.get_mapgen_setting("mgv7_shadow_limit") or 1024

minetest.clear_registered_biomes()
minetest.clear_registered_ores()
minetest.clear_registered_decorations()
Expand All @@ -2528,19 +2461,8 @@ local mg_name = minetest.get_mapgen_setting("mg_name")
if mg_name == "v6" then
default.register_mgv6_ores()
default.register_mgv6_decorations()
-- Need to check for 'nofloatlands' because that contains
-- 'floatlands' which makes the second condition true.
elseif mg_name == "v7" and
captures_float == "floatlands" and
captures_nofloat ~= "nofloatlands" then
-- Mgv7 with floatlands and floatland biomes
default.register_biomes(default.mgv7_shadow_limit - 1)
default.register_floatland_biomes(
default.mgv7_floatland_level, default.mgv7_shadow_limit)
default.register_ores()
default.register_decorations()
else
default.register_biomes(31000)
default.register_biomes()
default.register_ores()
default.register_decorations()
end
5 changes: 2 additions & 3 deletions mods/flowers/mapgen.lua
Expand Up @@ -100,7 +100,7 @@ local function register_flower(seed, flower_name)
octaves = 3,
persist = 0.6
},
biomes = {"grassland", "deciduous_forest", "floatland_grassland"},
biomes = {"grassland", "deciduous_forest"},
y_max = 31000,
y_min = 1,
decoration = "flowers:"..flower_name,
Expand All @@ -121,8 +121,7 @@ local function register_mushroom(mushroom_name)
octaves = 3,
persist = 0.66
},
biomes = {"deciduous_forest", "coniferous_forest",
"floatland_coniferous_forest"},
biomes = {"deciduous_forest", "coniferous_forest"},
y_max = 31000,
y_min = 1,
decoration = "flowers:"..mushroom_name,
Expand Down

0 comments on commit 150122b

Please sign in to comment.