Vanessa Ezekowitz
2017-04-01 eb344ad804aa83570ccda9a5886733d8b42aa598
commit | author | age
390ade 1 local uranium_params = {offset = 0, scale = 1, spread = {x = 100, y = 100, z = 100}, seed = 420, octaves = 3, persist = 0.7}
N 2 local uranium_threshhold = 0.55
3
4 local chromium_params = {offset = 0, scale = 1, spread = {x = 100, y = 100, z = 100}, seed = 421, octaves = 3, persist = 0.7}
5 local chromium_threshhold = 0.55
6
7 local zinc_params = {offset = 0, scale = 1, spread = {x = 100, y = 100, z = 100}, seed = 422, octaves = 3, persist = 0.7}
8 local zinc_threshhold = 0.5
9
3eefa2 10 local lead_params = {offset = 0, scale = 1, spread = {x = 100, y = 100, z = 100}, seed = 423, octaves = 3, persist = 0.7}
N 11 local lead_threshhold = 0.3
12
279776 13 minetest.register_ore({
390ade 14     ore_type         = "scatter",
N 15     ore              = "technic:mineral_uranium",
16     wherein          = "default:stone",
17     clust_scarcity   = 8*8*8,
18     clust_num_ores   = 4,
19     clust_size       = 3,
19f74d 20     y_min       = -300,
M 21     y_max       = -80,
390ade 22     noise_params     = uranium_params,
N 23     noise_threshhold = uranium_threshhold,
279776 24 })
ee0765 25
279776 26 minetest.register_ore({
390ade 27     ore_type         = "scatter",
N 28     ore              = "technic:mineral_chromium",
29     wherein          = "default:stone",
30     clust_scarcity   = 8*8*8,
31     clust_num_ores   = 2,
32     clust_size       = 3,
19f74d 33     y_min       = -200,
M 34     y_max       = -100,
390ade 35     noise_params     = chromium_params,
N 36     noise_threshhold = chromium_threshhold,
279776 37 })
ee0765 38
279776 39 minetest.register_ore({
390ade 40     ore_type         = "scatter",
N 41     ore              = "technic:mineral_chromium",
42     wherein          = "default:stone",
43     clust_scarcity   = 6*6*6,
44     clust_num_ores   = 2,
45     clust_size       = 3,
19f74d 46     y_min       = -31000,
M 47     y_max       = -200,
390ade 48     flags            = "absheight",
N 49     noise_params     = chromium_params,
50     noise_threshhold = chromium_threshhold,
51 })
52
53 minetest.register_ore({
54     ore_type         = "scatter",
55     ore              = "technic:mineral_zinc",
56     wherein          = "default:stone",
b7cecd 57     clust_scarcity   = 8*8*8,
f9a859 58     clust_num_ores   = 5,
M 59     clust_size       = 7,
19f74d 60     y_min       = -32,
b7cecd 61     y_max       = 2
390ade 62 })
N 63
64 minetest.register_ore({
65     ore_type         = "scatter",
66     ore              = "technic:mineral_zinc",
67     wherein          = "default:stone",
68     clust_scarcity   = 6*6*6,
69     clust_num_ores   = 4,
70     clust_size       = 3,
19f74d 71     y_min       = -31000,
M 72     y_max       = -32,
390ade 73     flags            = "absheight",
N 74     noise_params     = zinc_params,
75     noise_threshhold = zinc_threshhold,
279776 76 })
ee0765 77
3eefa2 78 minetest.register_ore({
N 79     ore_type         = "scatter",
80     ore              = "technic:mineral_lead",
81     wherein          = "default:stone",
82     clust_scarcity   = 9*9*9,
83     clust_num_ores   = 5,
84     clust_size       = 3,
19f74d 85     y_min       = -16,
M 86     y_max       = 16,
3eefa2 87     noise_params     = lead_params,
N 88     noise_threshhold = lead_threshhold,
89 })
90
91 minetest.register_ore({
92     ore_type         = "scatter",
93     ore              = "technic:mineral_lead",
94     wherein          = "default:stone",
95     clust_scarcity   = 8*8*8,
96     clust_num_ores   = 5,
97     clust_size       = 3,
19f74d 98     y_min       = -128,
M 99     y_max       = -16,
3eefa2 100     noise_params     = lead_params,
N 101     noise_threshhold = lead_threshhold,
102 })
103
104 minetest.register_ore({
105     ore_type         = "scatter",
106     ore              = "technic:mineral_lead",
107     wherein          = "default:stone",
108     clust_scarcity   = 6*6*6,
109     clust_num_ores   = 5,
110     clust_size       = 3,
19f74d 111     y_min       = -31000,
M 112     y_max       = -128,
3eefa2 113     flags            = "absheight",
N 114     noise_params     = lead_params,
115     noise_threshhold = lead_threshhold,
116 })
117
118 -- Sulfur
eb344a 119 local sulfur_buf = nil
VE 120 local sulfur_noise= nil
121
3eefa2 122 minetest.register_on_generated(function(minp, maxp, seed)
N 123     local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
124     local a = VoxelArea:new{
125         MinEdge = {x = emin.x, y = emin.y, z = emin.z},
126         MaxEdge = {x = emax.x, y = emax.y, z = emax.z},
127     }
eb344a 128     local data = vm:get_data(sulfur_buf)
3eefa2 129     local pr = PseudoRandom(17 * minp.x + 42 * minp.y + 101 * minp.z)
eb344a 130     sulfur_noise = sulfur_noise or minetest.get_perlin(9876, 3, 0.5, 100)
VE 131
3eefa2 132     local c_lava = minetest.get_content_id("default:lava_source")
N 133     local c_lava_flowing = minetest.get_content_id("default:lava_flowing")
134     local c_stone = minetest.get_content_id("default:stone")
135     local c_sulfur = minetest.get_content_id("technic:mineral_sulfur")
eb344a 136
3eefa2 137     local grid_size = 5
N 138     for x = minp.x + math.floor(grid_size / 2), maxp.x, grid_size do
139     for y = minp.y + math.floor(grid_size / 2), maxp.y, grid_size do
140     for z = minp.z + math.floor(grid_size / 2), maxp.z, grid_size do
141         local c = data[a:index(x, y, z)]
eb344a 142         if (c == c_lava or c == c_lava_flowing) and sulfur_noise:get3d({x = x, y = z, z = z}) >= 0.4 then
3eefa2 143             for xx = math.max(minp.x, x - grid_size), math.min(maxp.x, x + grid_size) do
N 144             for yy = math.max(minp.y, y - grid_size), math.min(maxp.y, y + grid_size) do
145             for zz = math.max(minp.z, z - grid_size), math.min(maxp.z, z + grid_size) do
146                 local i = a:index(xx, yy, zz)
147                 if data[i] == c_stone and pr:next(1, 10) <= 7 then
148                     data[i] = c_sulfur
149                 end
150             end
151             end
152             end
153         end
154     end
155     end
156     end
eb344a 157
3eefa2 158     vm:set_data(data)
N 159     vm:write_to_map(data)
160 end)
161
162
ee0765 163 if technic.config:get_bool("enable_marble_generation") then
279776 164 minetest.register_ore({
R 165     ore_type       = "sheet",
166     ore            = "technic:marble",
167     wherein        = "default:stone",
168     clust_scarcity = 1,
169     clust_num_ores = 1,
170     clust_size     = 3,
19f74d 171     y_min     = -31000,
M 172     y_max     = -50,
0ca19d 173     noise_threshhold = 0.4,
279776 174     noise_params = {offset=0, scale=15, spread={x=150, y=150, z=150}, seed=23, octaves=3, persist=0.70}
R 175 })
003286 176 end
ee0765 177
S 178 if technic.config:get_bool("enable_granite_generation") then
279776 179 minetest.register_ore({
R 180     ore_type       = "sheet",
181     ore            = "technic:granite",
182     wherein        = "default:stone",
183     clust_scarcity = 1,
184     clust_num_ores = 1,
185     clust_size     = 4,
19f74d 186     y_min     = -31000,
M 187     y_max     = -150,
0ca19d 188     noise_threshhold = 0.4,
279776 189     noise_params = {offset=0, scale=15, spread={x=130, y=130, z=130}, seed=24, octaves=3, persist=0.70}
R 190 })
003286 191 end
279776 192