default/mapgen.lua: Update biomes for new biome API

Register blob ores in mgv6 to replace addDirtGravelBlobs
Combine ores and blobs functions
This commit is contained in:
paramat 2015-03-08 05:17:22 +00:00
parent 794a436d86
commit a192f9fc78

View File

@ -28,7 +28,7 @@ minetest.register_alias("mapgen_desert_stone", "default:desert_stone")
minetest.register_alias("mapgen_stair_cobble", "stairs:stair_cobble") minetest.register_alias("mapgen_stair_cobble", "stairs:stair_cobble")
-- --
-- Ore generation -- Register ores
-- --
function default.register_ores() function default.register_ores()
@ -214,7 +214,7 @@ function default.register_ores()
wherein = {"default:sand"}, wherein = {"default:sand"},
clust_scarcity = 24*24*24, clust_scarcity = 24*24*24,
clust_size = 7, clust_size = 7,
y_min = -10, y_min = -15,
y_max = 0, y_max = 0,
noise_threshhold = 0, noise_threshhold = 0,
noise_params = { noise_params = {
@ -226,10 +226,68 @@ function default.register_ores()
persist=0.5 persist=0.5
}, },
}) })
minetest.register_ore({
ore_type = "blob",
ore = "default:sand",
wherein = {"default:stone"},
clust_scarcity = 24*24*24,
clust_size = 7,
y_min = -63,
y_max = 4,
noise_threshhold = 0,
noise_params = {
offset=0.35,
scale=0.2,
spread={x=5, y=5, z=5},
seed=2316,
octaves=1,
persist=0.5
},
})
minetest.register_ore({
ore_type = "blob",
ore = "default:dirt",
wherein = {"default:stone"},
clust_scarcity = 24*24*24,
clust_size = 7,
y_min = -63,
y_max = 31000,
noise_threshhold = 0,
noise_params = {
offset=0.35,
scale=0.2,
spread={x=5, y=5, z=5},
seed=17676,
octaves=1,
persist=0.5
},
})
minetest.register_ore({
ore_type = "blob",
ore = "default:gravel",
wherein = {"default:stone"},
clust_scarcity = 24*24*24,
clust_size = 7,
y_min = -31000,
y_max = 31000,
noise_threshhold = 0,
noise_params = {
offset=0.35,
scale=0.2,
spread={x=5, y=5, z=5},
seed=766,
octaves=1,
persist=0.5
},
})
end end
function default.generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, height_min, height_max) function default.generate_ore(name, wherein, minp, maxp, seed,
chunks_per_volume, chunk_size, ore_per_chunk, height_min, height_max)
minetest.log('action', "WARNING: default.generate_ore is deprecated") minetest.log('action', "WARNING: default.generate_ore is deprecated")
if maxp.y < height_min or minp.y > height_max then if maxp.y < height_min or minp.y > height_max then
@ -276,7 +334,6 @@ end
-- --
function default.mgv6_ongen(minp, maxp, seed) function default.mgv6_ongen(minp, maxp, seed)
function default.make_papyrus(pos, size) function default.make_papyrus(pos, size)
for y=0,size-1 do for y=0,size-1 do
local p = {x=pos.x, y=pos.y+y, z=pos.z} local p = {x=pos.x, y=pos.y+y, z=pos.z}
@ -411,7 +468,6 @@ function default.mgv6_ongen(minp, maxp, seed)
end end
end end
end end
end end
-- --
@ -478,30 +534,46 @@ function default.register_biomes()
minetest.clear_registered_biomes() minetest.clear_registered_biomes()
minetest.register_biome({ minetest.register_biome({
name = "grassland", name = "default:grassland",
--node_dust = "",
node_top = "default:dirt_with_grass", node_top = "default:dirt_with_grass",
node_shore_top = "default:sand",
depth_top = 1, depth_top = 1,
node_filler = "default:dirt", node_filler = "default:dirt",
node_shore_filler = "default:sand", depth_filler = 1,
depth_filler = 2,
height_shore = 3,
node_underwater = "default:sand",
--node_stone = "", --node_stone = "",
--node_water_top = "", --node_water_top = "",
--depth_water_top = , --depth_water_top = ,
--node_water = "", --node_water = "",
--node_dust = "", y_min = 5,
y_min = -31000,
y_max = 31000, y_max = 31000,
heat_point = 50, heat_point = 50,
humidity_point = 50, humidity_point = 50,
}) })
minetest.register_biome({
name = "default:grassland_ocean",
--node_dust = "",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 2,
--node_stone = "",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
y_min = -31000,
y_max = 4,
heat_point = 50,
humidity_point = 50,
})
end
-- --
-- Register decorations -- Register decorations
-- --
function default.register_decorations()
-- Flowers -- Flowers
minetest.register_decoration({ minetest.register_decoration({
@ -511,12 +583,12 @@ function default.register_biomes()
noise_params = { noise_params = {
offset = -0.02, offset = -0.02,
scale = 0.03, scale = 0.03,
spread = {x=100, y=100, z=100}, spread = {x=200, y=200, z=200},
seed = 436, seed = 436,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.6
}, },
biomes = {"grassland"}, biomes = {"default:grassland"},
y_min = -31000, y_min = -31000,
y_max = 31000, y_max = 31000,
decoration = "flowers:rose", decoration = "flowers:rose",
@ -529,13 +601,13 @@ function default.register_biomes()
noise_params = { noise_params = {
offset = -0.02, offset = -0.02,
scale = 0.03, scale = 0.03,
spread = {x=100, y=100, z=100}, spread = {x=200, y=200, z=200},
seed = 19822, seed = 19822,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.6
}, },
biomes = {"grassland"}, biomes = {"default:grassland"},
y_min = -31000, y_min = 33,
y_max = 31000, y_max = 31000,
decoration = "flowers:tulip", decoration = "flowers:tulip",
}) })
@ -547,12 +619,12 @@ function default.register_biomes()
noise_params = { noise_params = {
offset = -0.02, offset = -0.02,
scale = 0.03, scale = 0.03,
spread = {x=100, y=100, z=100}, spread = {x=200, y=200, z=200},
seed = 1220999, seed = 1220999,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.6
}, },
biomes = {"grassland"}, biomes = {"default:grassland"},
y_min = -31000, y_min = -31000,
y_max = 31000, y_max = 31000,
decoration = "flowers:dandelion_yellow", decoration = "flowers:dandelion_yellow",
@ -565,12 +637,12 @@ function default.register_biomes()
noise_params = { noise_params = {
offset = -0.02, offset = -0.02,
scale = 0.03, scale = 0.03,
spread = {x=100, y=100, z=100}, spread = {x=200, y=200, z=200},
seed = 36662, seed = 36662,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.6
}, },
biomes = {"grassland"}, biomes = {"default:grassland"},
y_min = -31000, y_min = -31000,
y_max = 31000, y_max = 31000,
decoration = "flowers:geranium", decoration = "flowers:geranium",
@ -583,12 +655,12 @@ function default.register_biomes()
noise_params = { noise_params = {
offset = -0.02, offset = -0.02,
scale = 0.03, scale = 0.03,
spread = {x=100, y=100, z=100}, spread = {x=200, y=200, z=200},
seed = 1133, seed = 1133,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.6
}, },
biomes = {"grassland"}, biomes = {"default:grassland"},
y_min = -31000, y_min = -31000,
y_max = 31000, y_max = 31000,
decoration = "flowers:viola", decoration = "flowers:viola",
@ -601,12 +673,12 @@ function default.register_biomes()
noise_params = { noise_params = {
offset = -0.02, offset = -0.02,
scale = 0.03, scale = 0.03,
spread = {x=100, y=100, z=100}, spread = {x=200, y=200, z=200},
seed = 73133, seed = 73133,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.6
}, },
biomes = {"grassland"}, biomes = {"default:grassland"},
y_min = -31000, y_min = -31000,
y_max = 31000, y_max = 31000,
decoration = "flowers:dandelion_white", decoration = "flowers:dandelion_white",
@ -620,13 +692,13 @@ function default.register_biomes()
sidelen = 16, sidelen = 16,
noise_params = { noise_params = {
offset = 0.04, offset = 0.04,
scale = 0.08, scale = 0.04,
spread = {x=100, y=100, z=100}, spread = {x=200, y=200, z=200},
seed = 66440, seed = 66440,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.6
}, },
biomes = {"grassland"}, biomes = {"default:grassland"},
y_min = -31000, y_min = -31000,
y_max = 31000, y_max = 31000,
decoration = "default:grass_1", decoration = "default:grass_1",
@ -638,13 +710,13 @@ function default.register_biomes()
sidelen = 16, sidelen = 16,
noise_params = { noise_params = {
offset = 0.02, offset = 0.02,
scale = 0.08, scale = 0.06,
spread = {x=100, y=100, z=100}, spread = {x=200, y=200, z=200},
seed = 66440, seed = 66440,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.6
}, },
biomes = {"grassland"}, biomes = {"default:grassland"},
y_min = -31000, y_min = -31000,
y_max = 31000, y_max = 31000,
decoration = "default:grass_2", decoration = "default:grass_2",
@ -657,12 +729,12 @@ function default.register_biomes()
noise_params = { noise_params = {
offset = 0, offset = 0,
scale = 0.08, scale = 0.08,
spread = {x=100, y=100, z=100}, spread = {x=200, y=200, z=200},
seed = 66440, seed = 66440,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.6
}, },
biomes = {"grassland"}, biomes = {"default:grassland"},
y_min = -31000, y_min = -31000,
y_max = 31000, y_max = 31000,
decoration = "default:grass_3", decoration = "default:grass_3",
@ -674,13 +746,13 @@ function default.register_biomes()
sidelen = 16, sidelen = 16,
noise_params = { noise_params = {
offset = -0.02, offset = -0.02,
scale = 0.08, scale = 0.10,
spread = {x=100, y=100, z=100}, spread = {x=200, y=200, z=200},
seed = 66440, seed = 66440,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.6
}, },
biomes = {"grassland"}, biomes = {"default:grassland"},
y_min = -31000, y_min = -31000,
y_max = 31000, y_max = 31000,
decoration = "default:grass_4", decoration = "default:grass_4",
@ -692,13 +764,13 @@ function default.register_biomes()
sidelen = 16, sidelen = 16,
noise_params = { noise_params = {
offset = -0.04, offset = -0.04,
scale = 0.08, scale = 0.12,
spread = {x=100, y=100, z=100}, spread = {x=200, y=200, z=200},
seed = 66440, seed = 66440,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.6
}, },
biomes = {"grassland"}, biomes = {"default:grassland"},
y_min = -31000, y_min = -31000,
y_max = 31000, y_max = 31000,
decoration = "default:grass_5", decoration = "default:grass_5",
@ -706,83 +778,20 @@ function default.register_biomes()
end end
-- --
-- Register blob ore -- Detect mapgen to select functions
--
function default.register_blobs()
minetest.register_ore({
ore_type = "blob",
ore = "default:sand",
wherein = {"default:stone"},
clust_scarcity = 24*24*24,
clust_size = 7,
y_min = -63,
y_max = 4,
noise_threshhold = 0,
noise_params = {
offset=0.35,
scale=0.2,
spread={x=5, y=5, z=5},
seed=2316,
octaves=1,
persist=0.5
},
})
minetest.register_ore({
ore_type = "blob",
ore = "default:dirt",
wherein = {"default:stone"},
clust_scarcity = 24*24*24,
clust_size = 7,
y_min = -63,
y_max = 31000,
noise_threshhold = 0,
noise_params = {
offset=0.35,
scale=0.2,
spread={x=5, y=5, z=5},
seed=17676,
octaves=1,
persist=0.5
},
})
minetest.register_ore({
ore_type = "blob",
ore = "default:gravel",
wherein = {"default:stone"},
clust_scarcity = 24*24*24,
clust_size = 7,
y_min = -31000,
y_max = 31000,
noise_threshhold = 0,
noise_params = {
offset=0.35,
scale=0.2,
spread={x=5, y=5, z=5},
seed=766,
octaves=1,
persist=0.5
},
})
end
--
-- Detect mapgen and select suitable biome code
-- --
local mg_params = minetest.get_mapgen_params() local mg_params = minetest.get_mapgen_params()
if mg_params.mgname == "v5" then if mg_params.mgname == "v5" then
default.register_biomes() default.register_biomes()
default.register_blobs() default.register_decorations()
default.register_ores() default.register_ores()
elseif mg_params.mgname == "v6" then elseif mg_params.mgname == "v6" then
minetest.register_on_generated(default.mgv6_ongen) minetest.register_on_generated(default.mgv6_ongen)
default.register_ores() default.register_ores()
elseif mg_params.mgname == "v7" then elseif mg_params.mgname == "v7" then
default.register_biomes() default.register_biomes()
default.register_blobs() default.register_decorations()
default.register_ores() default.register_ores()
end end