Camas/mods/default/mapgen.lua

435 lines
10 KiB
Lua
Raw Normal View History

2015-09-01 17:15:24 +02:00
-- minetest/default/mapgen.lua
--
-- Aliases for map generator outputs(Might not be needed with v7, but JIC)
2015-09-01 17:15:24 +02:00
--
minetest.register_alias("mapgen_stone", "default:stone")
minetest.register_alias("mapgen_tree", "default:tree")
minetest.register_alias("mapgen_leaves", "default:leaves")
minetest.register_alias("mapgen_apple", "default:apple")
minetest.register_alias("mapgen_water_source", "default:water_source")
2015-09-27 01:34:45 +02:00
minetest.register_alias("mapgen_river_water_source", "default:river_water_source")
2015-09-01 17:15:24 +02:00
minetest.register_alias("mapgen_dirt", "default:dirt")
minetest.register_alias("mapgen_sand", "default:sand")
minetest.register_alias("mapgen_desert_sand", "default:sand")
minetest.register_alias("mapgen_desert_stone", "default:sandstone")
minetest.register_alias("mapgen_gravel", "default:gravel")
minetest.register_alias("mapgen_cobble", "default:cobble")
minetest.register_alias("mapgen_mossycobble", "default:reinforced_cobble")
minetest.register_alias("mapgen_dirt_with_grass", "default:dirt_with_grass")
minetest.register_alias("mapgen_junglegrass", "default:grass")
minetest.register_alias("mapgen_stone_with_coal", "default:stone_with_coal")
minetest.register_alias("mapgen_stone_with_iron", "default:stone_with_iron")
minetest.register_alias("mapgen_mese", "default:block_steel")
minetest.register_alias("mapgen_stair_cobble", "default:reinforced_frame")
minetest.register_alias("mapgen_lava_source", "default:water_source")
--
-- Ore generation
--
2015-10-02 19:41:35 +02:00
-- Coal
2015-09-01 17:15:24 +02:00
minetest.register_ore(
{
ore_type = "scatter",
ore = "default:stone_with_coal",
wherein = "default:stone",
clust_scarcity = 10*10*10,
2015-09-01 17:15:24 +02:00
clust_num_ores = 6,
clust_size = 4,
height_min = -31000,
2015-09-01 17:15:24 +02:00
height_max = 32,
})
minetest.register_ore(
{
ore_type = "scatter",
ore = "default:stone_with_coal",
wherein = "default:stone",
clust_scarcity = 8*8*8,
clust_num_ores = 8,
clust_size = 6,
height_min = -31000,
height_max = -32,
})
minetest.register_ore(
{
ore_type = "scatter",
ore = "default:stone_with_coal",
wherein = "default:stone",
clust_scarcity = 9*9*9,
2015-09-01 17:15:24 +02:00
clust_num_ores = 20,
clust_size = 10,
height_min = -31000,
height_max = -64,
2015-09-01 17:15:24 +02:00
})
2015-10-02 19:41:35 +02:00
-- Iron
2015-09-01 17:15:24 +02:00
minetest.register_ore(
{
ore_type = "scatter",
ore = "default:stone_with_iron",
wherein = "default:stone",
clust_scarcity = 8*8*8,
clust_num_ores = 6,
clust_size = 4,
height_min = -31000,
2015-09-01 17:15:24 +02:00
height_max = 0,
})
minetest.register_ore(
{
ore_type = "scatter",
ore = "default:stone_with_iron",
wherein = "default:stone",
clust_scarcity = 8*8*8,
clust_num_ores = 20,
clust_size = 10,
height_min = -31000,
2015-09-01 17:15:24 +02:00
height_max = -32,
})
2015-10-02 19:41:35 +02:00
-- Steel blocks
2015-09-01 17:15:24 +02:00
minetest.register_ore(
{
ore_type = "blob",
ore = "default:block_steel",
wherein = "default:stone",
clust_scarcity = 12*12*12,
2015-09-01 17:15:24 +02:00
clust_num_ores = 10,
clust_size = 10,
height_min = -31000,
height_max = -128,
2015-09-01 17:15:24 +02:00
})
--
-- Biome setup
--
minetest.clear_registered_biomes()
2015-10-02 19:41:35 +02:00
-- Aboveground biomes
2015-09-01 17:15:24 +02:00
minetest.register_biome(
{
name = "Deep Forest",
2015-10-02 19:41:35 +02:00
node_top = "default:dirt_with_grass",
node_filler = "default:dirt",
depth_filler = 6,
depth_top = 1,
y_min = 2,
y_max = 50,
heat_point = 30,
humidity_point = 40,
})
2015-09-01 17:15:24 +02:00
minetest.register_biome(
{
name = "Forest",
2015-10-02 19:41:35 +02:00
node_top = "default:dirt_with_grass",
node_filler = "default:dirt",
depth_filler = 6,
depth_top = 1,
y_min = 2,
y_max = 200,
heat_point = 35,
humidity_point = 40,
2015-09-01 17:15:24 +02:00
})
minetest.register_biome(
{
name = "Grassland",
2015-10-02 19:41:35 +02:00
node_top = "default:dirt_with_grass",
node_filler = "default:dirt",
depth_filler = 3,
depth_top = 1,
y_min = 3,
y_max = 32000,
heat_point = 50,
humidity_point = 35,
2015-09-01 17:15:24 +02:00
})
minetest.register_biome(
{
name = "Savanna",
2015-10-02 19:41:35 +02:00
node_top = "default:dirt_with_dry_grass",
node_filler = "default:dirt",
depth_filler = 2,
depth_top = 1,
y_min = 0,
y_max = 32000,
heat_point = 60,
humidity_point = 30,
})
2015-09-01 17:15:24 +02:00
minetest.register_biome(
{
name = "Desert",
2015-10-02 19:41:35 +02:00
node_top = "default:sand",
node_filler = "default:sandstone",
depth_filler = 8,
depth_top = 3,
y_min = 0,
y_max = 32000,
heat_point = 70,
humidity_point = 20,
})
-- Oceans
minetest.register_biome(
{
name = "Grassland Ocean",
node_top = "default:sand",
node_filler = "default:dirt",
depth_filler = 1,
depth_top = 3,
y_min = -32000,
y_max = 2,
heat_point = 50,
humidity_point = 35,
2015-09-01 17:15:24 +02:00
})
2015-10-02 19:41:35 +02:00
minetest.register_biome(
{
name = "Savanna Ocean",
node_top = "default:dirt",
node_filler = "dfault:dirt",
depth_filler = 0,
depth_top = 1,
y_min = -32000,
y_max = -1,
heat_point = 60,
humidity_point = 30,
})
--
2015-09-01 17:15:24 +02:00
-- Decorations
2015-10-02 19:41:35 +02:00
--
-- Trees
2015-09-01 17:15:24 +02:00
minetest.register_decoration(
{
deco_type = "schematic",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
2015-10-02 19:41:35 +02:00
fill_ratio = 0.004,
biomes = {"Forest"},
2015-09-01 17:15:24 +02:00
flags = "place_center_x, place_center_z",
2015-10-02 19:41:35 +02:00
replacements = {["default:leaves"] = "default:leaves_birch", ["default:tree"] = "default:tree_birch", ["default:apple"] = "air"},
schematic = minetest.get_modpath("default").."/schematics/default_squaretree.mts",
2015-09-01 17:15:24 +02:00
y_min = -32000,
y_max = 32000,
})
minetest.register_decoration(
{
deco_type = "schematic",
2015-09-01 23:29:41 +02:00
place_on = {"default:dirt_with_grass"},
2015-09-01 17:15:24 +02:00
sidelen = 16,
2015-10-02 19:41:35 +02:00
fill_ratio = 0.005,
biomes = {"Grassland"},
2015-09-01 17:15:24 +02:00
flags = "place_center_x, place_center_z",
2015-09-01 23:29:41 +02:00
schematic = minetest.get_modpath("default").."/schematics/default_tree.mts",
2015-10-02 19:41:35 +02:00
y_min = 10,
2015-09-01 23:29:41 +02:00
y_max = 32000,
})
minetest.register_decoration(
{
deco_type = "schematic",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
2015-10-02 19:41:35 +02:00
fill_ratio = 0.009,
biomes = {"Forest", "Deep Forest"},
2015-09-01 23:29:41 +02:00
flags = "place_center_x, place_center_z",
2015-10-02 19:41:35 +02:00
replacements = {["default:leaves"] = "default:leaves_oak", ["default:tree"] = "default:tree_oak", ["default:apple"] = "air"},
schematic = minetest.get_modpath("default").."/schematics/default_tree.mts",
2015-09-01 17:15:24 +02:00
y_min = -32000,
y_max = 32000,
})
minetest.register_decoration(
{
deco_type = "schematic",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
2015-10-02 19:41:35 +02:00
fill_ratio = 0.008,
2015-09-01 17:15:24 +02:00
biomes = {"Forest"},
flags = "place_center_x, place_center_z",
2015-10-02 19:41:35 +02:00
schematic = minetest.get_modpath("default").."/schematics/default_megatree.mts",
2015-09-01 17:15:24 +02:00
y_min = -32000,
y_max = 32000,
})
minetest.register_decoration(
{
deco_type = "schematic",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
2015-10-02 19:41:35 +02:00
fill_ratio = 0.028,
biomes = {"Deep Forest"},
2015-09-01 17:15:24 +02:00
flags = "place_center_x, place_center_z",
2015-10-02 19:41:35 +02:00
schematic = minetest.get_modpath("default").."/schematics/default_gigatree.mts",
2015-09-01 17:15:24 +02:00
y_min = -32000,
y_max = 32000,
})
2015-10-02 19:41:35 +02:00
-- Papyrus
2015-09-01 17:15:24 +02:00
minetest.register_decoration(
{
deco_type = "simple",
place_on = {"default:sand", "default:dirt", "default:dirt_with_grass"},
spawn_by = {"default:water_source", "default:water_flowing"},
num_spawn_by = 1,
2015-09-01 17:15:24 +02:00
sidelen = 16,
fill_ratio = 0.08,
2015-10-02 19:41:35 +02:00
biomes = {"Grassland Ocean", "Grassland", "Forest", "Deep Forest"},
decoration = {"default:papyrus"},
height = 2,
height_max = 3,
y_min = 0,
y_max = 31000,
})
2015-10-02 19:41:35 +02:00
-- Grasses
2015-09-01 17:15:24 +02:00
minetest.register_decoration(
{
deco_type = "simple",
place_on = "default:dirt_with_grass",
sidelen = 16,
2015-09-01 23:29:41 +02:00
fill_ratio = 0.18,
biomes = {"Grassland"},
decoration = {"default:grass"},
y_min = 0,
y_max = 32000,
})
minetest.register_decoration(
{
deco_type = "simple",
place_on = "default:dirt_with_dry_grass",
sidelen = 16,
fill_ratio = 0.07,
2015-10-02 19:41:35 +02:00
biomes = {"Desert", "Savanna"},
decoration = {"default:dry_grass"},
2015-10-02 19:41:35 +02:00
y_min = 10,
y_max = 500,
})
2015-09-01 23:29:41 +02:00
minetest.register_decoration(
{
deco_type = "simple",
place_on = "default:dirt_with_grass",
sidelen = 16,
fill_ratio = 0.08,
biomes = {"Forest", "Deep Forest"},
2015-09-01 17:15:24 +02:00
decoration = {"default:grass"},
y_min = 0,
y_max = 32000,
})
minetest.register_decoration(
{
deco_type = "simple",
place_on = "default:dirt_with_grass",
sidelen = 16,
fill_ratio = 0.08,
biomes = {"Forest"},
decoration = {"default:tall_grass"},
y_min = 0,
y_max = 32000,
})
2015-09-01 23:29:41 +02:00
minetest.register_decoration(
{
deco_type = "simple",
place_on = "default:dirt_with_grass",
sidelen = 16,
fill_ratio = 0.15,
biomes = {"Deep Forest"},
decoration = {"default:tall_grass"},
y_min = 0,
y_max = 32000,
})
2015-10-02 19:41:35 +02:00
-- Farming
if minetest.get_modpath("farming") ~= nil then
minetest.register_decoration(
{
deco_type = "simple",
place_on = "default:dirt_with_grass",
sidelen = 16,
fill_ratio = 0.006,
biomes = {"Grassland", "Savanna"},
decoration = {"farming:wheat_4"},
y_min = 0,
y_max = 32000,
})
minetest.register_decoration(
{
deco_type = "simple",
place_on = "default:sand",
sidelen = 16,
fill_ratio = 0.004,
biomes = {"Desert"},
decoration = {"farming:cotton_4"},
y_min = 0,
y_max = 32000,
})
end
-- Cactus
2015-09-01 17:15:24 +02:00
minetest.register_decoration(
{
deco_type = "schematic",
place_on = {"default:sand"},
sidelen = 16,
fill_ratio = 0.004,
biomes = {"Desert"},
flags = "place_center_x, place_center_z",
schematic = minetest.get_modpath("default").."/schematics/default_cactus.mts",
2015-10-02 19:41:35 +02:00
y_min = 10,
y_max = 500,
2015-09-01 17:15:24 +02:00
rotation = "random",
})
default.log("mapgen", "loaded")