Alexander German
2017-03-28 b7cecd7f3dfde8a8a322379dd163fdd451b64c03
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
119 minetest.register_on_generated(function(minp, maxp, seed)
120     local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
121     local a = VoxelArea:new{
122         MinEdge = {x = emin.x, y = emin.y, z = emin.z},
123         MaxEdge = {x = emax.x, y = emax.y, z = emax.z},
124     }
125     local data = vm:get_data()
126     local pr = PseudoRandom(17 * minp.x + 42 * minp.y + 101 * minp.z)
127     local noise = minetest.get_perlin(9876, 3, 0.5, 100)
128     
129     local c_lava = minetest.get_content_id("default:lava_source")
130     local c_lava_flowing = minetest.get_content_id("default:lava_flowing")
131     local c_stone = minetest.get_content_id("default:stone")
132     local c_sulfur = minetest.get_content_id("technic:mineral_sulfur")
133     
134     local grid_size = 5
135     for x = minp.x + math.floor(grid_size / 2), maxp.x, grid_size do
136     for y = minp.y + math.floor(grid_size / 2), maxp.y, grid_size do
137     for z = minp.z + math.floor(grid_size / 2), maxp.z, grid_size do
138         local c = data[a:index(x, y, z)]
139         if (c == c_lava or c == c_lava_flowing) and noise:get3d({x = x, y = z, z = z}) >= 0.4 then
140             for xx = math.max(minp.x, x - grid_size), math.min(maxp.x, x + grid_size) do
141             for yy = math.max(minp.y, y - grid_size), math.min(maxp.y, y + grid_size) do
142             for zz = math.max(minp.z, z - grid_size), math.min(maxp.z, z + grid_size) do
143                 local i = a:index(xx, yy, zz)
144                 if data[i] == c_stone and pr:next(1, 10) <= 7 then
145                     data[i] = c_sulfur
146                 end
147             end
148             end
149             end
150         end
151     end
152     end
153     end
154     
155     vm:set_data(data)
156     vm:write_to_map(data)
157 end)
158
159
ee0765 160 if technic.config:get_bool("enable_marble_generation") then
279776 161 minetest.register_ore({
R 162     ore_type       = "sheet",
163     ore            = "technic:marble",
164     wherein        = "default:stone",
165     clust_scarcity = 1,
166     clust_num_ores = 1,
167     clust_size     = 3,
19f74d 168     y_min     = -31000,
M 169     y_max     = -50,
0ca19d 170     noise_threshhold = 0.4,
279776 171     noise_params = {offset=0, scale=15, spread={x=150, y=150, z=150}, seed=23, octaves=3, persist=0.70}
R 172 })
003286 173 end
ee0765 174
S 175 if technic.config:get_bool("enable_granite_generation") then
279776 176 minetest.register_ore({
R 177     ore_type       = "sheet",
178     ore            = "technic:granite",
179     wherein        = "default:stone",
180     clust_scarcity = 1,
181     clust_num_ores = 1,
182     clust_size     = 4,
19f74d 183     y_min     = -31000,
M 184     y_max     = -150,
0ca19d 185     noise_threshhold = 0.4,
279776 186     noise_params = {offset=0, scale=15, spread={x=130, y=130, z=130}, seed=24, octaves=3, persist=0.70}
R 187 })
003286 188 end
279776 189