Mapgen: Dedicated registrations for mgv6 blob ores

Now that biomes are being specified for blob ores we need a separate
set of blob ore registrations for mgv6 which has no Biome API biomes
defined.
Various minor improvements to mapgen.lua.
This commit is contained in:
paramat 2017-02-01 18:44:50 +00:00
parent 2b215848d8
commit 2e950ac61c

View File

@ -1,5 +1,5 @@
-- --
-- Aliases for map generator outputs -- Aliases for map generators
-- --
minetest.register_alias("mapgen_stone", "default:stone") minetest.register_alias("mapgen_stone", "default:stone")
@ -43,11 +43,103 @@ minetest.register_alias("mapgen_stair_sandstonebrick", "stairs:stair_sandstonebr
-- Register ores -- Register ores
-- --
function default.register_ores() -- Blob ores
minetest.clear_registered_ores() -- These first to avoid other ores in blobs
-- Blob ores -- Mgv6
-- These first to avoid other ores in blobs
function default.register_mgv6_blob_ores()
-- Clay
-- This first to avoid clay in sand blobs
minetest.register_ore({
ore_type = "blob",
ore = "default:clay",
wherein = {"default:sand"},
clust_scarcity = 16 * 16 * 16,
clust_size = 5,
y_min = -15,
y_max = 0,
noise_threshold = 0.0,
noise_params = {
offset = 0.5,
scale = 0.2,
spread = {x = 5, y = 5, z = 5},
seed = -316,
octaves = 1,
persist = 0.0
},
})
-- Sand
minetest.register_ore({
ore_type = "blob",
ore = "default:sand",
wherein = {"default:stone", "default:desert_stone"},
clust_scarcity = 16 * 16 * 16,
clust_size = 5,
y_min = -31,
y_max = 0,
noise_threshold = 0.0,
noise_params = {
offset = 0.5,
scale = 0.2,
spread = {x = 5, y = 5, z = 5},
seed = 2316,
octaves = 1,
persist = 0.0
},
})
-- Dirt
minetest.register_ore({
ore_type = "blob",
ore = "default:dirt",
wherein = {"default:stone"},
clust_scarcity = 16 * 16 * 16,
clust_size = 5,
y_min = -31,
y_max = 31000,
noise_threshold = 0.0,
noise_params = {
offset = 0.5,
scale = 0.2,
spread = {x = 5, y = 5, z = 5},
seed = 17676,
octaves = 1,
persist = 0.0
},
})
-- Gravel
minetest.register_ore({
ore_type = "blob",
ore = "default:gravel",
wherein = {"default:stone"},
clust_scarcity = 16 * 16 * 16,
clust_size = 5,
y_min = -31000,
y_max = 31000,
noise_threshold = 0.0,
noise_params = {
offset = 0.5,
scale = 0.2,
spread = {x = 5, y = 5, z = 5},
seed = 766,
octaves = 1,
persist = 0.0
},
})
end
-- All mapgens except mgv6
function default.register_blob_ores()
-- Clay -- Clay
@ -149,8 +241,13 @@ function default.register_ores()
"cold_desert_ocean", "savanna", "savanna_shore", "savanna_ocean", "cold_desert_ocean", "savanna", "savanna_shore", "savanna_ocean",
"rainforest", "rainforest_swamp", "rainforest_ocean", "underground"} "rainforest", "rainforest_swamp", "rainforest_ocean", "underground"}
}) })
end
-- Scatter ores
-- Scatter ores
-- All mapgens
function default.register_ores()
-- Coal -- Coal
@ -392,10 +489,9 @@ end
-- Register biomes -- Register biomes
-- --
-- All mapgens except mgv6 and singlenode -- All mapgens except mgv6
function default.register_biomes() function default.register_biomes()
minetest.clear_registered_biomes()
-- Icesheet -- Icesheet
@ -1048,7 +1144,6 @@ end
-- Mgv6 -- Mgv6
function default.register_mgv6_decorations() function default.register_mgv6_decorations()
minetest.clear_registered_decorations()
-- Papyrus -- Papyrus
@ -1181,7 +1276,6 @@ end
function default.register_decorations() function default.register_decorations()
minetest.clear_registered_decorations()
-- Apple tree and log -- Apple tree and log
@ -1563,12 +1657,18 @@ end
-- Detect mapgen to select functions -- Detect mapgen to select functions
-- --
minetest.clear_registered_biomes()
minetest.clear_registered_ores()
minetest.clear_registered_decorations()
local mg_name = minetest.get_mapgen_setting("mg_name") local mg_name = minetest.get_mapgen_setting("mg_name")
if mg_name == "v6" then if mg_name == "v6" then
default.register_mgv6_blob_ores()
default.register_ores() default.register_ores()
default.register_mgv6_decorations() default.register_mgv6_decorations()
else else
default.register_biomes() default.register_biomes()
default.register_blob_ores()
default.register_ores() default.register_ores()
default.register_decorations() default.register_decorations()
end end