2018-07-21 20:09:27 +03:00
|
|
|
local uranium_params = {
|
|
|
|
offset = 0,
|
|
|
|
scale = 1,
|
|
|
|
spread = {x = 100, y = 100, z = 100},
|
|
|
|
seed = 420,
|
|
|
|
octaves = 3,
|
|
|
|
persist = 0.7
|
|
|
|
}
|
2017-01-03 04:50:58 +03:00
|
|
|
local uranium_threshold = 0.55
|
2014-08-17 19:08:11 +04:00
|
|
|
|
2018-07-21 20:09:27 +03:00
|
|
|
local chromium_params = {
|
|
|
|
offset = 0,
|
|
|
|
scale = 1,
|
|
|
|
spread = {x = 100, y = 100, z = 100},
|
|
|
|
seed = 421,
|
|
|
|
octaves = 3,
|
|
|
|
persist = 0.7
|
|
|
|
}
|
2017-01-03 04:50:58 +03:00
|
|
|
local chromium_threshold = 0.55
|
2014-08-17 19:08:11 +04:00
|
|
|
|
2018-07-21 20:09:27 +03:00
|
|
|
local zinc_params = {
|
|
|
|
offset = 0,
|
|
|
|
scale = 1,
|
|
|
|
spread = {x = 100, y = 100, z = 100},
|
|
|
|
seed = 422,
|
|
|
|
octaves = 3,
|
|
|
|
persist = 0.7
|
|
|
|
}
|
2017-01-03 04:50:58 +03:00
|
|
|
local zinc_threshold = 0.5
|
2014-08-17 19:08:11 +04:00
|
|
|
|
2018-07-21 20:09:27 +03:00
|
|
|
local lead_params = {
|
|
|
|
offset = 0,
|
|
|
|
scale = 1,
|
|
|
|
spread = {x = 100, y = 100, z = 100},
|
|
|
|
seed = 423,
|
|
|
|
octaves = 3,
|
|
|
|
persist = 0.7
|
|
|
|
}
|
2017-01-03 04:50:58 +03:00
|
|
|
local lead_threshold = 0.3
|
2015-02-22 14:42:46 +03:00
|
|
|
|
2013-03-30 14:36:45 +04:00
|
|
|
minetest.register_ore({
|
2018-07-21 20:09:27 +03:00
|
|
|
ore_type = "scatter",
|
|
|
|
ore = "technic:mineral_uranium",
|
|
|
|
wherein = "default:stone",
|
|
|
|
clust_scarcity = 8*8*8,
|
|
|
|
clust_num_ores = 4,
|
|
|
|
clust_size = 3,
|
|
|
|
y_min = -300,
|
|
|
|
y_max = -80,
|
|
|
|
noise_params = uranium_params,
|
2017-01-03 04:50:58 +03:00
|
|
|
noise_threshold = uranium_threshold,
|
2013-03-30 14:36:45 +04:00
|
|
|
})
|
2013-07-17 23:34:35 +04:00
|
|
|
|
2013-03-30 14:36:45 +04:00
|
|
|
minetest.register_ore({
|
2018-07-21 20:09:27 +03:00
|
|
|
ore_type = "scatter",
|
|
|
|
ore = "technic:mineral_chromium",
|
|
|
|
wherein = "default:stone",
|
|
|
|
clust_scarcity = 8*8*8,
|
|
|
|
clust_num_ores = 2,
|
|
|
|
clust_size = 3,
|
|
|
|
y_min = -200,
|
|
|
|
y_max = -100,
|
|
|
|
noise_params = chromium_params,
|
2017-01-03 04:50:58 +03:00
|
|
|
noise_threshold = chromium_threshold,
|
2013-03-30 14:36:45 +04:00
|
|
|
})
|
2013-07-17 23:34:35 +04:00
|
|
|
|
2013-03-30 14:36:45 +04:00
|
|
|
minetest.register_ore({
|
2018-07-21 20:09:27 +03:00
|
|
|
ore_type = "scatter",
|
|
|
|
ore = "technic:mineral_chromium",
|
|
|
|
wherein = "default:stone",
|
|
|
|
clust_scarcity = 6*6*6,
|
|
|
|
clust_num_ores = 2,
|
|
|
|
clust_size = 3,
|
|
|
|
y_min = -31000,
|
|
|
|
y_max = -200,
|
|
|
|
flags = "absheight",
|
|
|
|
noise_params = chromium_params,
|
2017-01-03 04:50:58 +03:00
|
|
|
noise_threshold = chromium_threshold,
|
2014-08-17 19:08:11 +04:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_ore({
|
2018-07-21 20:09:27 +03:00
|
|
|
ore_type = "scatter",
|
|
|
|
ore = "technic:mineral_zinc",
|
|
|
|
wherein = "default:stone",
|
|
|
|
clust_scarcity = 8*8*8,
|
|
|
|
clust_num_ores = 5,
|
|
|
|
clust_size = 7,
|
|
|
|
y_min = -32,
|
|
|
|
y_max = 2,
|
|
|
|
noise_params = zinc_params,
|
2017-01-03 04:50:58 +03:00
|
|
|
noise_threshold = zinc_threshold,
|
2014-08-17 19:08:11 +04:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_ore({
|
2018-07-21 20:09:27 +03:00
|
|
|
ore_type = "scatter",
|
|
|
|
ore = "technic:mineral_zinc",
|
|
|
|
wherein = "default:stone",
|
|
|
|
clust_scarcity = 6*6*6,
|
|
|
|
clust_num_ores = 4,
|
|
|
|
clust_size = 3,
|
|
|
|
y_min = -31000,
|
|
|
|
y_max = -32,
|
|
|
|
flags = "absheight",
|
|
|
|
noise_params = zinc_params,
|
2017-01-03 04:50:58 +03:00
|
|
|
noise_threshold = zinc_threshold,
|
2013-03-30 14:36:45 +04:00
|
|
|
})
|
2013-07-17 23:34:35 +04:00
|
|
|
|
2015-02-22 14:42:46 +03:00
|
|
|
minetest.register_ore({
|
2018-07-21 20:09:27 +03:00
|
|
|
ore_type = "scatter",
|
|
|
|
ore = "technic:mineral_lead",
|
|
|
|
wherein = "default:stone",
|
|
|
|
clust_scarcity = 9*9*9,
|
|
|
|
clust_num_ores = 5,
|
|
|
|
clust_size = 3,
|
|
|
|
y_min = -16,
|
|
|
|
y_max = 16,
|
|
|
|
noise_params = lead_params,
|
2017-01-03 04:50:58 +03:00
|
|
|
noise_threshold = lead_threshold,
|
2015-02-22 14:42:46 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_ore({
|
2018-07-21 20:09:27 +03:00
|
|
|
ore_type = "scatter",
|
|
|
|
ore = "technic:mineral_lead",
|
|
|
|
wherein = "default:stone",
|
|
|
|
clust_scarcity = 8*8*8,
|
|
|
|
clust_num_ores = 5,
|
|
|
|
clust_size = 3,
|
|
|
|
y_min = -128,
|
|
|
|
y_max = -16,
|
|
|
|
noise_params = lead_params,
|
2017-01-03 04:50:58 +03:00
|
|
|
noise_threshold = lead_threshold,
|
2015-02-22 14:42:46 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_ore({
|
2018-07-21 20:09:27 +03:00
|
|
|
ore_type = "scatter",
|
|
|
|
ore = "technic:mineral_lead",
|
|
|
|
wherein = "default:stone",
|
|
|
|
clust_scarcity = 6*6*6,
|
|
|
|
clust_num_ores = 5,
|
|
|
|
clust_size = 3,
|
|
|
|
y_min = -31000,
|
|
|
|
y_max = -128,
|
|
|
|
flags = "absheight",
|
|
|
|
noise_params = lead_params,
|
2017-01-03 04:50:58 +03:00
|
|
|
noise_threshold = lead_threshold,
|
2015-02-22 14:42:46 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
-- Sulfur
|
2017-06-05 17:59:16 +03:00
|
|
|
local sulfur_buf = {}
|
2018-07-21 20:09:27 +03:00
|
|
|
local sulfur_noise
|
2017-04-01 04:34:57 +03:00
|
|
|
|
2018-07-21 20:09:27 +03:00
|
|
|
minetest.register_on_generated(function(minp, maxp)
|
2015-02-22 14:42:46 +03:00
|
|
|
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
|
2018-07-21 20:09:27 +03:00
|
|
|
local a = VoxelArea:new({MinEdge=emin, MaxEdge=emax})
|
2017-04-01 04:34:57 +03:00
|
|
|
local data = vm:get_data(sulfur_buf)
|
2015-02-22 14:42:46 +03:00
|
|
|
local pr = PseudoRandom(17 * minp.x + 42 * minp.y + 101 * minp.z)
|
2017-04-01 04:34:57 +03:00
|
|
|
sulfur_noise = sulfur_noise or minetest.get_perlin(9876, 3, 0.5, 100)
|
|
|
|
|
2015-02-22 14:42:46 +03:00
|
|
|
local c_lava = minetest.get_content_id("default:lava_source")
|
|
|
|
local c_lava_flowing = minetest.get_content_id("default:lava_flowing")
|
|
|
|
local c_stone = minetest.get_content_id("default:stone")
|
|
|
|
local c_sulfur = minetest.get_content_id("technic:mineral_sulfur")
|
2017-04-01 04:34:57 +03:00
|
|
|
|
2015-02-22 14:42:46 +03:00
|
|
|
local grid_size = 5
|
|
|
|
for x = minp.x + math.floor(grid_size / 2), maxp.x, grid_size do
|
|
|
|
for y = minp.y + math.floor(grid_size / 2), maxp.y, grid_size do
|
|
|
|
for z = minp.z + math.floor(grid_size / 2), maxp.z, grid_size do
|
|
|
|
local c = data[a:index(x, y, z)]
|
2018-07-16 18:25:53 +03:00
|
|
|
if (c == c_lava or c == c_lava_flowing)
|
2018-08-04 10:57:30 +03:00
|
|
|
and sulfur_noise:get3d({x = x, y = z, z = z}) >= 0.4 then
|
2018-07-16 18:25:53 +03:00
|
|
|
for i in a:iter(
|
|
|
|
math.max(minp.x, x - grid_size),
|
|
|
|
math.max(minp.y, y - grid_size),
|
|
|
|
math.max(minp.z, z - grid_size),
|
|
|
|
math.min(maxp.x, x + grid_size),
|
|
|
|
math.min(maxp.y, y + grid_size),
|
|
|
|
math.min(maxp.z, z + grid_size)
|
|
|
|
) do
|
2015-02-22 14:42:46 +03:00
|
|
|
if data[i] == c_stone and pr:next(1, 10) <= 7 then
|
|
|
|
data[i] = c_sulfur
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2017-04-01 04:34:57 +03:00
|
|
|
|
2015-02-22 14:42:46 +03:00
|
|
|
vm:set_data(data)
|
|
|
|
vm:write_to_map(data)
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
2013-07-17 23:34:35 +04:00
|
|
|
if technic.config:get_bool("enable_marble_generation") then
|
2018-07-21 20:09:27 +03:00
|
|
|
minetest.register_ore({
|
|
|
|
ore_type = "sheet",
|
|
|
|
ore = "technic:marble",
|
|
|
|
wherein = "default:stone",
|
|
|
|
clust_scarcity = 1,
|
|
|
|
clust_num_ores = 1,
|
|
|
|
clust_size = 3,
|
|
|
|
y_min = -31000,
|
|
|
|
y_max = -50,
|
|
|
|
noise_threshold = 0.4,
|
|
|
|
noise_params = {
|
|
|
|
offset = 0, scale = 15, spread = {x = 150, y = 150, z = 150},
|
|
|
|
seed = 23, octaves = 3, persist = 0.70
|
|
|
|
}
|
|
|
|
})
|
2013-04-26 05:39:08 +04:00
|
|
|
end
|
2013-07-17 23:34:35 +04:00
|
|
|
|
|
|
|
if technic.config:get_bool("enable_granite_generation") then
|
2018-07-21 20:09:27 +03:00
|
|
|
minetest.register_ore({
|
|
|
|
ore_type = "sheet",
|
|
|
|
ore = "technic:granite",
|
|
|
|
wherein = "default:stone",
|
|
|
|
clust_scarcity = 1,
|
|
|
|
clust_num_ores = 1,
|
|
|
|
clust_size = 4,
|
|
|
|
y_min = -31000,
|
|
|
|
y_max = -150,
|
|
|
|
noise_threshold = 0.4,
|
|
|
|
noise_params = {
|
|
|
|
offset = 0, scale = 15, spread = {x = 130, y = 130, z = 130},
|
|
|
|
seed = 24, octaves = 3, persist = 0.70
|
|
|
|
}
|
|
|
|
})
|
2013-04-26 05:39:08 +04:00
|
|
|
end
|