Novatux
2015-02-22 3eefa2f18134ab59139f73f4bbf918024c494d7f
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,
20     height_min       = -300,
21     height_max       = -80,
22     noise_params     = uranium_params,
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,
33     height_min       = -200,
34     height_max       = -100,
35     noise_params     = chromium_params,
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,
46     height_min       = -31000,
47     height_max       = -200,
48     flags            = "absheight",
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",
57     clust_scarcity   = 8*8*8,
58     clust_num_ores   = 4,
59     clust_size       = 3,
60     height_min       = -32,
61     height_max       = 2,
62     noise_params     = zinc_params,
63     noise_threshhold = zinc_threshhold,
64 })
65
66 minetest.register_ore({
67     ore_type         = "scatter",
68     ore              = "technic:mineral_zinc",
69     wherein          = "default:stone",
70     clust_scarcity   = 6*6*6,
71     clust_num_ores   = 4,
72     clust_size       = 3,
73     height_min       = -31000,
74     height_max       = -32,
75     flags            = "absheight",
76     noise_params     = zinc_params,
77     noise_threshhold = zinc_threshhold,
279776 78 })
ee0765 79
3eefa2 80 minetest.register_ore({
N 81     ore_type         = "scatter",
82     ore              = "technic:mineral_lead",
83     wherein          = "default:stone",
84     clust_scarcity   = 9*9*9,
85     clust_num_ores   = 5,
86     clust_size       = 3,
87     height_min       = -16,
88     height_max       = 16,
89     noise_params     = lead_params,
90     noise_threshhold = lead_threshhold,
91 })
92
93 minetest.register_ore({
94     ore_type         = "scatter",
95     ore              = "technic:mineral_lead",
96     wherein          = "default:stone",
97     clust_scarcity   = 8*8*8,
98     clust_num_ores   = 5,
99     clust_size       = 3,
100     height_min       = -128,
101     height_max       = -16,
102     noise_params     = lead_params,
103     noise_threshhold = lead_threshhold,
104 })
105
106 minetest.register_ore({
107     ore_type         = "scatter",
108     ore              = "technic:mineral_lead",
109     wherein          = "default:stone",
110     clust_scarcity   = 6*6*6,
111     clust_num_ores   = 5,
112     clust_size       = 3,
113     height_min       = -31000,
114     height_max       = -128,
115     flags            = "absheight",
116     noise_params     = lead_params,
117     noise_threshhold = lead_threshhold,
118 })
119
120 -- Sulfur
121 minetest.register_on_generated(function(minp, maxp, seed)
122     local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
123     local a = VoxelArea:new{
124         MinEdge = {x = emin.x, y = emin.y, z = emin.z},
125         MaxEdge = {x = emax.x, y = emax.y, z = emax.z},
126     }
127     local data = vm:get_data()
128     local pr = PseudoRandom(17 * minp.x + 42 * minp.y + 101 * minp.z)
129     local noise = minetest.get_perlin(9876, 3, 0.5, 100)
130     
131     local c_lava = minetest.get_content_id("default:lava_source")
132     local c_lava_flowing = minetest.get_content_id("default:lava_flowing")
133     local c_stone = minetest.get_content_id("default:stone")
134     local c_sulfur = minetest.get_content_id("technic:mineral_sulfur")
135     
136     local grid_size = 5
137     for x = minp.x + math.floor(grid_size / 2), maxp.x, grid_size do
138     for y = minp.y + math.floor(grid_size / 2), maxp.y, grid_size do
139     for z = minp.z + math.floor(grid_size / 2), maxp.z, grid_size do
140         local c = data[a:index(x, y, z)]
141         if (c == c_lava or c == c_lava_flowing) and noise:get3d({x = x, y = z, z = z}) >= 0.4 then
142             for xx = math.max(minp.x, x - grid_size), math.min(maxp.x, x + grid_size) do
143             for yy = math.max(minp.y, y - grid_size), math.min(maxp.y, y + grid_size) do
144             for zz = math.max(minp.z, z - grid_size), math.min(maxp.z, z + grid_size) do
145                 local i = a:index(xx, yy, zz)
146                 if data[i] == c_stone and pr:next(1, 10) <= 7 then
147                     data[i] = c_sulfur
148                 end
149             end
150             end
151             end
152         end
153     end
154     end
155     end
156     
157     vm:set_data(data)
158     vm:write_to_map(data)
159 end)
160
161
ee0765 162 if technic.config:get_bool("enable_marble_generation") then
279776 163 minetest.register_ore({
R 164     ore_type       = "sheet",
165     ore            = "technic:marble",
166     wherein        = "default:stone",
167     clust_scarcity = 1,
168     clust_num_ores = 1,
169     clust_size     = 3,
0ca19d 170     height_min     = -31000,
279776 171     height_max     = -50,
0ca19d 172     noise_threshhold = 0.4,
279776 173     noise_params = {offset=0, scale=15, spread={x=150, y=150, z=150}, seed=23, octaves=3, persist=0.70}
R 174 })
003286 175 end
ee0765 176
S 177 if technic.config:get_bool("enable_granite_generation") then
279776 178 minetest.register_ore({
R 179     ore_type       = "sheet",
180     ore            = "technic:granite",
181     wherein        = "default:stone",
182     clust_scarcity = 1,
183     clust_num_ores = 1,
184     clust_size     = 4,
0ca19d 185     height_min     = -31000,
R 186     height_max     = -150,
187     noise_threshhold = 0.4,
279776 188     noise_params = {offset=0, scale=15, spread={x=130, y=130, z=130}, seed=24, octaves=3, persist=0.70}
R 189 })
003286 190 end
279776 191