Skip to content

Commit 48baf1a

Browse files
committedJul 22, 2017
Floatland biomes: Update due to mgv7 biomerepeat option
Only register floatland biomes if mgv7 'biomerepeat' flag is false. Simplify floatland biomes to coniferous forest and ocean. Make 'mgv7_floatland_level' and 'mgv7_shadow_limit' parameters global values for mods to use to register their own floatland biomes.
1 parent 886537e commit 48baf1a

File tree

2 files changed

+27
-105
lines changed

2 files changed

+27
-105
lines changed
 

‎mods/default/mapgen.lua

+26-104
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,6 @@ function default.register_ores()
463463
"deciduous_forest_shore", "deciduous_forest_ocean", "cold_desert",
464464
"cold_desert_ocean", "savanna", "savanna_shore", "savanna_ocean",
465465
"rainforest", "rainforest_swamp", "rainforest_ocean", "underground",
466-
"floatland_grassland", "floatland_grassland_ocean",
467466
"floatland_coniferous_forest", "floatland_coniferous_forest_ocean"}
468467
})
469468

@@ -488,8 +487,7 @@ function default.register_ores()
488487
},
489488
biomes = {"taiga", "snowy_grassland", "grassland", "coniferous_forest",
490489
"deciduous_forest", "deciduous_forest_shore", "savanna", "savanna_shore",
491-
"rainforest", "rainforest_swamp", "floatland_grassland",
492-
"floatland_coniferous_forest"}
490+
"rainforest", "rainforest_swamp", "floatland_coniferous_forest"}
493491
})
494492

495493
-- Gravel
@@ -518,7 +516,6 @@ function default.register_ores()
518516
"deciduous_forest_shore", "deciduous_forest_ocean", "cold_desert",
519517
"cold_desert_ocean", "savanna", "savanna_shore", "savanna_ocean",
520518
"rainforest", "rainforest_swamp", "rainforest_ocean", "underground",
521-
"floatland_grassland", "floatland_grassland_ocean",
522519
"floatland_coniferous_forest", "floatland_coniferous_forest_ocean"}
523520
})
524521

@@ -1448,6 +1445,8 @@ end
14481445

14491446

14501447
-- Biomes for floatlands
1448+
-- Used when mgv7 'biomerepeat' flag is false
1449+
-- TODO Temporary simple biomes to be developed later
14511450

14521451
function default.register_floatland_biomes(floatland_level, shadow_limit)
14531452

@@ -1467,10 +1466,10 @@ function default.register_floatland_biomes(floatland_level, shadow_limit)
14671466
--node_river_water = "",
14681467
--node_riverbed = "",
14691468
--depth_riverbed = ,
1470-
y_min = floatland_level + 2,
1469+
y_min = floatland_level + 4,
14711470
y_max = 31000,
14721471
heat_point = 50,
1473-
humidity_point = 70,
1472+
humidity_point = 50,
14741473
})
14751474

14761475
-- Coniferous forest ocean
@@ -1490,97 +1489,9 @@ function default.register_floatland_biomes(floatland_level, shadow_limit)
14901489
--node_riverbed = "",
14911490
--depth_riverbed = ,
14921491
y_min = shadow_limit,
1493-
y_max = floatland_level + 1,
1494-
heat_point = 50,
1495-
humidity_point = 70,
1496-
})
1497-
1498-
-- Grassland
1499-
1500-
minetest.register_biome({
1501-
name = "floatland_grassland",
1502-
--node_dust = "",
1503-
node_top = "default:dirt_with_grass",
1504-
depth_top = 1,
1505-
node_filler = "default:dirt",
1506-
depth_filler = 1,
1507-
--node_stone = "",
1508-
--node_water_top = "",
1509-
--depth_water_top = ,
1510-
--node_water = "",
1511-
--node_river_water = "",
1512-
--node_riverbed = "",
1513-
--depth_riverbed = ,
1514-
y_min = floatland_level + 2,
1515-
y_max = 31000,
1516-
heat_point = 50,
1517-
humidity_point = 35,
1518-
})
1519-
1520-
-- Grassland ocean
1521-
1522-
minetest.register_biome({
1523-
name = "floatland_grassland_ocean",
1524-
--node_dust = "",
1525-
node_top = "default:sand",
1526-
depth_top = 1,
1527-
node_filler = "default:sand",
1528-
depth_filler = 3,
1529-
--node_stone = "",
1530-
--node_water_top = "",
1531-
--depth_water_top = ,
1532-
--node_water = "",
1533-
--node_river_water = "",
1534-
--node_riverbed = "",
1535-
--depth_riverbed = ,
1536-
y_min = shadow_limit,
1537-
y_max = floatland_level + 1,
1538-
heat_point = 50,
1539-
humidity_point = 35,
1540-
})
1541-
1542-
-- Sandstone desert
1543-
1544-
minetest.register_biome({
1545-
name = "floatland_sandstone_desert",
1546-
--node_dust = "",
1547-
node_top = "default:sand",
1548-
depth_top = 1,
1549-
node_filler = "default:sand",
1550-
depth_filler = 1,
1551-
node_stone = "default:sandstone",
1552-
--node_water_top = "",
1553-
--depth_water_top = ,
1554-
--node_water = "",
1555-
--node_river_water = "",
1556-
--node_riverbed = "",
1557-
--depth_riverbed = ,
1558-
y_min = floatland_level + 2,
1559-
y_max = 31000,
1560-
heat_point = 50,
1561-
humidity_point = 0,
1562-
})
1563-
1564-
-- Sandstone desert ocean
1565-
1566-
minetest.register_biome({
1567-
name = "floatland_sandstone_desert_ocean",
1568-
--node_dust = "",
1569-
node_top = "default:sand",
1570-
depth_top = 1,
1571-
node_filler = "default:sand",
1572-
depth_filler = 3,
1573-
node_stone = "default:sandstone",
1574-
--node_water_top = "",
1575-
--depth_water_top = ,
1576-
--node_water = "",
1577-
--node_river_water = "",
1578-
--node_riverbed = "",
1579-
--depth_riverbed = ,
1580-
y_min = shadow_limit,
1581-
y_max = floatland_level + 1,
1492+
y_max = floatland_level + 3,
15821493
heat_point = 50,
1583-
humidity_point = 0,
1494+
humidity_point = 50,
15841495
})
15851496
end
15861497

@@ -2110,26 +2021,37 @@ end
21102021

21112022
-- Get setting or default
21122023
local mgv7_spflags = minetest.get_mapgen_setting("mgv7_spflags") or
2113-
"mountains, ridges, nofloatlands"
2024+
"mountains, ridges, nofloatlands, caverns, biomerepeat"
21142025
local captures_float = string.match(mgv7_spflags, "floatlands")
21152026
local captures_nofloat = string.match(mgv7_spflags, "nofloatlands")
2027+
local captures_nobiorep = string.match(mgv7_spflags, "nobiomerepeat")
21162028

2117-
local mgv7_floatland_level = minetest.get_mapgen_setting("mgv7_floatland_level") or 1280
2118-
local mgv7_shadow_limit = minetest.get_mapgen_setting("mgv7_shadow_limit") or 1024
2029+
-- Get setting or default
2030+
-- Make global for mods to use to register floatland biomes
2031+
default.mgv7_floatland_level =
2032+
minetest.get_mapgen_setting("mgv7_floatland_level") or 1280
2033+
default.mgv7_shadow_limit =
2034+
minetest.get_mapgen_setting("mgv7_shadow_limit") or 1024
21192035

21202036
minetest.clear_registered_biomes()
21212037
minetest.clear_registered_ores()
21222038
minetest.clear_registered_decorations()
21232039

21242040
local mg_name = minetest.get_mapgen_setting("mg_name")
2041+
21252042
if mg_name == "v6" then
21262043
default.register_mgv6_ores()
21272044
default.register_mgv6_decorations()
2128-
elseif mg_name == "v7" and captures_float == "floatlands" and
2129-
captures_nofloat ~= "nofloatlands" then
2130-
-- Mgv7 with floatlands
2131-
default.register_biomes(mgv7_shadow_limit - 1)
2132-
default.register_floatland_biomes(mgv7_floatland_level, mgv7_shadow_limit)
2045+
elseif mg_name == "v7" and
2046+
captures_float == "floatlands" and
2047+
-- Need to check for 'nofloatlands' because that contains
2048+
-- 'floatlands' which makes the second condition true.
2049+
captures_nofloat ~= "nofloatlands" and
2050+
captures_nobiorep == "nobiomerepeat" then
2051+
-- Mgv7 with floatlands and floatland biomes
2052+
default.register_biomes(default.mgv7_shadow_limit - 1)
2053+
default.register_floatland_biomes(
2054+
default.mgv7_floatland_level, default.mgv7_shadow_limit)
21332055
default.register_ores()
21342056
default.register_decorations()
21352057
else

‎mods/flowers/mapgen.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ local function register_flower(seed, name)
9595
persist = 0.6
9696
},
9797
biomes = {"grassland", "deciduous_forest", "coniferous_forest",
98-
"floatland_grassland", "floatland_coniferous_forest"},
98+
"floatland_coniferous_forest"},
9999
y_min = 1,
100100
y_max = 31000,
101101
decoration = "flowers:"..name,

0 commit comments

Comments
 (0)
Please sign in to comment.