363 lines
8.4 KiB
Lua
363 lines
8.4 KiB
Lua
minetest.register_alias("mapgen_stone", "pyutest_core:stone_block")
|
|
minetest.register_alias("mapgen_water_source", "pyutest_core:water_source")
|
|
minetest.register_alias("mapgen_river_water_source", "pyutest_core:water_source")
|
|
minetest.register_alias("mapgen_lava_source", "pyutest_core:water_source")
|
|
minetest.register_alias("mapgen_singlenode", "air")
|
|
|
|
-- Biomes
|
|
|
|
-- these values are yoinked from VoxeLibre
|
|
-- (https://git.minetest.land/VoxeLibre/VoxeLibre/src/branch/master/mods/MAPGEN/mcl_biomes/init.lua)
|
|
PyuTestCore_OceanMin = -15
|
|
PyuTestCore_DeepOceanMax = PyuTestCore_OceanMin - 1
|
|
PyuTestCore_DeepOceanMin = -31
|
|
|
|
|
|
PyuTestCore_SurfaceBottom = 2
|
|
PyuTestCore_WorldBottom = -31000
|
|
|
|
PyuTestCore_BiomeTops = {
|
|
grassland = 40,
|
|
forest = 45,
|
|
desert = 70,
|
|
frozen_plains = 50,
|
|
mountains = 300,
|
|
mushroom_fields = 40,
|
|
volcano = 70,
|
|
oillands = 45,
|
|
ice_spikes = 250
|
|
}
|
|
|
|
-- wrapper around minetest.register_biome but with defaults.
|
|
PyuTestCore.register_biome = function(opts)
|
|
local nopts = PyuTestCore.util.tablecopy(opts) or {}
|
|
nopts["depth_top"] = nopts["depth_top"] or 1
|
|
nopts["depth_filler"] = nopts["depth_filler"] or 3
|
|
nopts["depth_riverbed"] = nopts["depth_riverbed"] or 2
|
|
nopts["depth_water_top"] = nopts["depth_water_top"] or nil -- cant think of a sane default..
|
|
|
|
nopts["node_river_water"] = nopts["node_river_water"] or "pyutest_core:water_source"
|
|
nopts["node_riverbed"] = nopts["node_riverbed"] or "pyutest_core:gravel_block"
|
|
|
|
minetest.register_biome(nopts)
|
|
end
|
|
|
|
PyuTestCore.register_ocean = function(name, heat_point, top_node, water_node, ground_node)
|
|
PyuTestCore.register_biome({
|
|
name = name.."_ocean",
|
|
node_water = water_node or "pyutest_core:water_source",
|
|
node_river_water = water_node or "pyutest_core:water_source",
|
|
node_riverbed = ground_node or "pyutest_core:gravel_block",
|
|
node_top = ground_node or "pyutest_core:gravel_block",
|
|
depth_top = 3,
|
|
node_water_top = top_node or nil,
|
|
depth_water_top = 5,
|
|
y_max = 0,
|
|
y_min = PyuTestCore_OceanMin,
|
|
heat_point = heat_point or 50,
|
|
humidity_point = 100
|
|
})
|
|
|
|
PyuTestCore.register_biome({
|
|
name = name.."_deep_ocean",
|
|
node_water = water_node or "pyutest_core:water_source",
|
|
node_river_water = water_node or "pyutest_core:water_source",
|
|
node_riverbed = ground_node or "pyutest_core:gravel_block",
|
|
node_top = ground_node or "pyutest_core:gravel_block",
|
|
depth_top = 3,
|
|
node_water_top = top_node or nil,
|
|
depth_water_top = 5,
|
|
y_max = PyuTestCore_DeepOceanMax,
|
|
y_min = PyuTestCore_DeepOceanMin,
|
|
heat_point = heat_point or 30,
|
|
humidity_point = 100
|
|
})
|
|
end
|
|
|
|
PyuTestCore.register_biome({
|
|
name = "beach",
|
|
|
|
node_top = "pyutest_core:sand_block",
|
|
node_filler = nil,
|
|
|
|
y_max = PyuTestCore_SurfaceBottom,
|
|
y_min = PyuTestCore_SurfaceBottom - 1,
|
|
|
|
heat_point = 40,
|
|
humidity_point = 40
|
|
})
|
|
|
|
PyuTestCore.register_biome({
|
|
name = "snowy_beach",
|
|
|
|
node_dust = "pyutest_core:snow_carpet",
|
|
|
|
node_top = "pyutest_core:sand_block",
|
|
node_filler = nil,
|
|
|
|
y_max = PyuTestCore_SurfaceBottom,
|
|
y_min = PyuTestCore_SurfaceBottom - 3,
|
|
|
|
heat_point = 9,
|
|
humidity_point = 40
|
|
})
|
|
|
|
PyuTestCore.register_biome({
|
|
name = "grassland",
|
|
|
|
node_top = "pyutest_core:grass_block",
|
|
node_filler = "pyutest_core:dirt_block",
|
|
|
|
y_max = PyuTestCore_BiomeTops.grassland,
|
|
y_min = PyuTestCore_SurfaceBottom,
|
|
|
|
heat_point = 53,
|
|
humidity_point = 38,
|
|
})
|
|
|
|
PyuTestCore.register_biome({
|
|
name = "forest",
|
|
|
|
node_top = "pyutest_core:dark_grass_block",
|
|
node_filler = "pyutest_core:dirt_block",
|
|
|
|
y_max = PyuTestCore_BiomeTops.forest,
|
|
y_min = PyuTestCore_SurfaceBottom,
|
|
|
|
heat_point = 50,
|
|
humidity_point = 63
|
|
})
|
|
|
|
PyuTestCore.register_biome({
|
|
name = "stony_mountains",
|
|
|
|
node_top = "pyutest_core:stone_block",
|
|
node_filler = "pyutest_core:stone_block",
|
|
|
|
y_max = PyuTestCore_BiomeTops.mountains,
|
|
y_min = PyuTestCore_BiomeTops.grassland,
|
|
|
|
heat_point = 45,
|
|
humidity_point = 34
|
|
})
|
|
|
|
PyuTestCore.register_biome({
|
|
name = "desert",
|
|
|
|
node_top = "pyutest_core:sand_block",
|
|
node_filler = "pyutest_core:sandstone_block",
|
|
|
|
y_max = PyuTestCore_BiomeTops.desert,
|
|
y_min = PyuTestCore_SurfaceBottom,
|
|
|
|
heat_point = 78,
|
|
humidity_point = 4
|
|
})
|
|
|
|
PyuTestCore.register_biome({
|
|
name = "desert_mountains",
|
|
|
|
node_top = "pyutest_core:sand_block",
|
|
node_filler = "pyutest_core:sandstone_block",
|
|
|
|
y_max = PyuTestCore_BiomeTops.mountains,
|
|
y_min = PyuTestCore_BiomeTops.desert,
|
|
|
|
heat_point = 65,
|
|
humidity_point = 8
|
|
})
|
|
|
|
PyuTestCore.register_biome({
|
|
name = "snowy_mountains",
|
|
|
|
node_top = "pyutest_core:snow_block",
|
|
node_filler = "pyutest_core:snow_block",
|
|
|
|
y_max = PyuTestCore_BiomeTops.mountains,
|
|
y_min = PyuTestCore_BiomeTops.frozen_plains,
|
|
|
|
heat_point = 6,
|
|
humidity_point = 23
|
|
})
|
|
|
|
PyuTestCore.register_biome({
|
|
name = "frozen_plains",
|
|
|
|
node_dust = "pyutest_core:snow_carpet",
|
|
|
|
node_top = "pyutest_core:snow_block",
|
|
node_filler = "pyutest_core:snow_block",
|
|
|
|
node_water_top = "pyutest_core:ice_block",
|
|
depth_water_top = 10,
|
|
|
|
y_max = PyuTestCore_BiomeTops.frozen_plains,
|
|
y_min = PyuTestCore_SurfaceBottom,
|
|
|
|
heat_point = 9,
|
|
humidity_point = 32
|
|
})
|
|
|
|
PyuTestCore.register_biome({
|
|
name = "wasteland",
|
|
|
|
node_top = "pyutest_core:dirt_block",
|
|
node_filler = "pyutest_core:dirt_block",
|
|
|
|
node_water_top = "pyutest_core:ice_block",
|
|
depth_water_top = 10,
|
|
|
|
y_max = PyuTestCore_BiomeTops.frozen_plains,
|
|
y_min = PyuTestCore_SurfaceBottom,
|
|
heat_point = 9,
|
|
humidity_point = 9
|
|
})
|
|
|
|
PyuTestCore.register_biome({
|
|
name = "mushroom_fields",
|
|
node_top = "pyutest_core:mycelium_block",
|
|
node_filler = "pyutest_core:dirt_block",
|
|
|
|
y_max = PyuTestCore_BiomeTops.mushroom_fields,
|
|
y_min = PyuTestCore_SurfaceBottom,
|
|
|
|
heat_point = 34,
|
|
humidity_point = 76
|
|
})
|
|
|
|
PyuTestCore.register_biome({
|
|
name = "volcano",
|
|
|
|
node_top = "pyutest_core:molten_rock_block",
|
|
node_filler = "pyutest_core:basalt_block",
|
|
depth_filler = 9,
|
|
|
|
node_water = "pyutest_core:lava_source",
|
|
node_river_water = "pyutest_core:lava_source",
|
|
|
|
y_max = PyuTestCore_BiomeTops.volcano,
|
|
y_min = PyuTestCore_SurfaceBottom,
|
|
|
|
heat_point = 98,
|
|
humidity_point = 3
|
|
})
|
|
|
|
PyuTestCore.register_biome({
|
|
name = "ice_spikes",
|
|
|
|
node_top = "pyutest_core:ice_block",
|
|
node_filler = "pyutest_core:ice_block",
|
|
|
|
node_water_top = "pyutest_core:ice_block",
|
|
depth_water_top = 10,
|
|
|
|
y_max = PyuTestCore_BiomeTops.ice_spikes,
|
|
y_min = PyuTestCore_SurfaceBottom,
|
|
heat_point = 9,
|
|
humidity_point = 28
|
|
})
|
|
|
|
PyuTestCore.register_biome({
|
|
name = "grassy_hills",
|
|
node_top = "pyutest_core:dark_grass_block",
|
|
node_filler = "pyutest_core:dirt_block",
|
|
depth_filler = 4,
|
|
|
|
y_max = PyuTestCore_BiomeTops.mountains,
|
|
y_min = PyuTestCore_BiomeTops.grassland,
|
|
|
|
heat_point = 36,
|
|
humidity_point = 54
|
|
})
|
|
|
|
PyuTestCore.register_biome({
|
|
name = "old_growth_forest",
|
|
|
|
node_top = "pyutest_core:dark_grass_block",
|
|
node_filler = "pyutest_core:dirt_block",
|
|
|
|
y_max = PyuTestCore_BiomeTops.forest,
|
|
y_min = PyuTestCore_SurfaceBottom,
|
|
|
|
heat_point = 38,
|
|
humidity_point = 66
|
|
})
|
|
|
|
PyuTestCore.register_biome({
|
|
name = "snowy_forest",
|
|
|
|
node_top = "pyutest_core:snow_block",
|
|
node_filler = "pyutest_core:dirt_block",
|
|
|
|
y_max = PyuTestCore_BiomeTops.forest,
|
|
y_min = PyuTestCore_SurfaceBottom,
|
|
|
|
heat_point = 8,
|
|
humidity_point = 28
|
|
})
|
|
|
|
PyuTestCore.register_biome({
|
|
name = "savanna",
|
|
|
|
node_top = "pyutest_core:savanna_grass_block",
|
|
node_filler = "pyutest_core:dirt_block",
|
|
|
|
y_max = PyuTestCore_BiomeTops.grassland,
|
|
y_min = PyuTestCore_SurfaceBottom,
|
|
|
|
heat_point = 58,
|
|
humidity_point = 38
|
|
})
|
|
|
|
PyuTestCore.register_biome({
|
|
name = "taiga",
|
|
|
|
node_top = "pyutest_core:dark_grass_block",
|
|
node_filler = "pyutest_core:dirt_block",
|
|
|
|
y_max = PyuTestCore_BiomeTops.forest,
|
|
y_min = PyuTestCore_SurfaceBottom,
|
|
|
|
heat_point = 28,
|
|
humidity_point = 53
|
|
})
|
|
|
|
PyuTestCore.register_biome({
|
|
name = "birch_forest",
|
|
|
|
node_top = "pyutest_core:grass_block",
|
|
node_filler = "pyutest_core:dirt_block",
|
|
|
|
y_max = PyuTestCore_BiomeTops.forest,
|
|
y_min = PyuTestCore_SurfaceBottom,
|
|
|
|
heat_point = 38,
|
|
humidity_point = 63
|
|
})
|
|
|
|
PyuTestCore.register_biome({
|
|
name = "cherry_grove",
|
|
|
|
node_top = "pyutest_core:grass_block",
|
|
node_filler = "pyutest_core:dirt_block",
|
|
|
|
y_max = PyuTestCore_BiomeTops.forest,
|
|
y_min = PyuTestCore_SurfaceBottom,
|
|
|
|
heat_point = 36,
|
|
humidity_point = 64
|
|
})
|
|
|
|
PyuTestCore.register_ocean("normal")
|
|
|
|
PyuTestCore.BIOMES = {}
|
|
for k, _ in pairs(minetest.registered_biomes) do
|
|
table.insert(PyuTestCore.BIOMES, k)
|
|
end
|
|
|
|
-- Structures
|
|
dofile(PyuTestCore_Path.."/structures.lua")
|
|
|
|
-- Trees, Plants and More
|
|
dofile(PyuTestCore_Path.."/trees.lua")
|