77 lines
1.7 KiB
Lua
77 lines
1.7 KiB
Lua
PyuTest.register_world = function (options)
|
|
local default_options = {}
|
|
local conf = {}
|
|
|
|
for k, v in pairs(options) do
|
|
conf[k] = v
|
|
end
|
|
|
|
for k, v in pairs(default_options) do
|
|
if conf[k] == nil then
|
|
conf[k] = v
|
|
end
|
|
end
|
|
|
|
if conf.y_max == nil or conf.y_min == nil then
|
|
error("Please supply 'y_max' and 'y_min' to the options table!")
|
|
end
|
|
|
|
if conf.name == nil then
|
|
error("Please supply 'name' in the options table!")
|
|
end
|
|
|
|
return {
|
|
name = conf.name,
|
|
y_max = conf.y_max,
|
|
y_min = conf.y_min,
|
|
register_biome = function (o)
|
|
local name = conf.name .. "-" .. o.name
|
|
|
|
minetest.register_biome(PyuTest.util.tableconcat(o, {
|
|
name = name,
|
|
depth_top = 0,
|
|
depth_filler = 0,
|
|
y_max = conf.y_max,
|
|
y_min = conf.y_min,
|
|
node_water = "air",
|
|
node_river_water = "air",
|
|
node_cave_liquid = "air",
|
|
vertical_blend = 5
|
|
}))
|
|
|
|
return name
|
|
end,
|
|
|
|
register_ore = function (o)
|
|
minetest.register_ore(PyuTest.util.tableconcat(o, {
|
|
y_max = conf.y_max,
|
|
y_min = conf.y_min,
|
|
}))
|
|
end
|
|
}
|
|
end
|
|
|
|
SpecialCaveWorld = PyuTest.register_world({
|
|
name = "special_cave_world",
|
|
y_max = PyuTest.OVERWORLD_BOTTOM,
|
|
y_min = PyuTest.OVERWORLD_BOTTOM * 2
|
|
})
|
|
|
|
local icy_cave = SpecialCaveWorld.register_biome({
|
|
name = "icy_cave",
|
|
node_stone = "pyutest_core:ice_block",
|
|
heat_point = 14,
|
|
humidity_point = 0
|
|
})
|
|
|
|
SpecialCaveWorld.register_ore({
|
|
ore_type = "blob",
|
|
ore = "pyutest_core:snow_block",
|
|
wherein = "pyutest_core:ice_block",
|
|
clust_scarcity = 3 * 3 * 3,
|
|
clust_num_ores = 35,
|
|
clust_size = 5,
|
|
biomes = {icy_cave},
|
|
noise_params = PyuTest.SPECIALSTONE_NOISE_PARAMS
|
|
})
|