Skip to content

Commit 5797968

Browse files
committedJul 2, 2017
Mapgen: Completely separate mgv6 ore registrations
This allows us to preserve mgv6 ore distribution while giving us the freedom to alter ore distribution for other mapgens. Other mapgens are larger scale and have 3D noise tunnels which make vertical travel easier, so ores can be deeper. Other mapgens have registered biomes which allows us to limit ores to certain biomes.
1 parent 2e413b5 commit 5797968

File tree

1 file changed

+282
-15
lines changed

1 file changed

+282
-15
lines changed
 

Diff for: ‎mods/default/mapgen.lua

+282-15
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ minetest.register_alias("mapgen_stair_sandstone_block", "stairs:stair_sandstone_
4343
-- Register ores
4444
--
4545

46-
-- Blob ores
47-
-- These first to avoid other ores in blobs
48-
4946
-- Mgv6
5047

51-
function default.register_mgv6_blob_ores()
48+
function default.register_mgv6_ores()
49+
50+
-- Blob ore
51+
-- These first to avoid other ores in blobs
5252

5353
-- Clay
5454
-- This first to avoid clay in sand blobs
@@ -134,14 +134,289 @@ function default.register_mgv6_blob_ores()
134134
persist = 0.0
135135
},
136136
})
137+
138+
-- Scatter ores
139+
140+
-- Coal
141+
142+
minetest.register_ore({
143+
ore_type = "scatter",
144+
ore = "default:stone_with_coal",
145+
wherein = "default:stone",
146+
clust_scarcity = 8 * 8 * 8,
147+
clust_num_ores = 9,
148+
clust_size = 3,
149+
y_min = 1025,
150+
y_max = 31000,
151+
})
152+
153+
minetest.register_ore({
154+
ore_type = "scatter",
155+
ore = "default:stone_with_coal",
156+
wherein = "default:stone",
157+
clust_scarcity = 8 * 8 * 8,
158+
clust_num_ores = 8,
159+
clust_size = 3,
160+
y_min = -31000,
161+
y_max = 64,
162+
})
163+
164+
minetest.register_ore({
165+
ore_type = "scatter",
166+
ore = "default:stone_with_coal",
167+
wherein = "default:stone",
168+
clust_scarcity = 24 * 24 * 24,
169+
clust_num_ores = 27,
170+
clust_size = 6,
171+
y_min = -31000,
172+
y_max = 0,
173+
})
174+
175+
-- Iron
176+
177+
minetest.register_ore({
178+
ore_type = "scatter",
179+
ore = "default:stone_with_iron",
180+
wherein = "default:stone",
181+
clust_scarcity = 9 * 9 * 9,
182+
clust_num_ores = 12,
183+
clust_size = 3,
184+
y_min = 1025,
185+
y_max = 31000,
186+
})
187+
188+
minetest.register_ore({
189+
ore_type = "scatter",
190+
ore = "default:stone_with_iron",
191+
wherein = "default:stone",
192+
clust_scarcity = 7 * 7 * 7,
193+
clust_num_ores = 5,
194+
clust_size = 3,
195+
y_min = -31000,
196+
y_max = 0,
197+
})
198+
199+
minetest.register_ore({
200+
ore_type = "scatter",
201+
ore = "default:stone_with_iron",
202+
wherein = "default:stone",
203+
clust_scarcity = 24 * 24 * 24,
204+
clust_num_ores = 27,
205+
clust_size = 6,
206+
y_min = -31000,
207+
y_max = -64,
208+
})
209+
210+
-- Copper
211+
212+
minetest.register_ore({
213+
ore_type = "scatter",
214+
ore = "default:stone_with_copper",
215+
wherein = "default:stone",
216+
clust_scarcity = 9 * 9 * 9,
217+
clust_num_ores = 5,
218+
clust_size = 3,
219+
y_min = 1025,
220+
y_max = 31000,
221+
})
222+
223+
minetest.register_ore({
224+
ore_type = "scatter",
225+
ore = "default:stone_with_copper",
226+
wherein = "default:stone",
227+
clust_scarcity = 12 * 12 * 12,
228+
clust_num_ores = 4,
229+
clust_size = 3,
230+
y_min = -63,
231+
y_max = -16,
232+
})
233+
234+
minetest.register_ore({
235+
ore_type = "scatter",
236+
ore = "default:stone_with_copper",
237+
wherein = "default:stone",
238+
clust_scarcity = 9 * 9 * 9,
239+
clust_num_ores = 5,
240+
clust_size = 3,
241+
y_min = -31000,
242+
y_max = -64,
243+
})
244+
245+
-- Tin
246+
247+
minetest.register_ore({
248+
ore_type = "scatter",
249+
ore = "default:stone_with_tin",
250+
wherein = "default:stone",
251+
clust_scarcity = 10 * 10 * 10,
252+
clust_num_ores = 5,
253+
clust_size = 3,
254+
y_min = 1025,
255+
y_max = 31000,
256+
})
257+
258+
minetest.register_ore({
259+
ore_type = "scatter",
260+
ore = "default:stone_with_tin",
261+
wherein = "default:stone",
262+
clust_scarcity = 13 * 13 * 13,
263+
clust_num_ores = 4,
264+
clust_size = 3,
265+
y_min = -127,
266+
y_max = -32,
267+
})
268+
269+
minetest.register_ore({
270+
ore_type = "scatter",
271+
ore = "default:stone_with_tin",
272+
wherein = "default:stone",
273+
clust_scarcity = 10 * 10 * 10,
274+
clust_num_ores = 5,
275+
clust_size = 3,
276+
y_min = -31000,
277+
y_max = -128,
278+
})
279+
280+
-- Gold
281+
282+
minetest.register_ore({
283+
ore_type = "scatter",
284+
ore = "default:stone_with_gold",
285+
wherein = "default:stone",
286+
clust_scarcity = 13 * 13 * 13,
287+
clust_num_ores = 5,
288+
clust_size = 3,
289+
y_min = 1025,
290+
y_max = 31000,
291+
})
292+
293+
minetest.register_ore({
294+
ore_type = "scatter",
295+
ore = "default:stone_with_gold",
296+
wherein = "default:stone",
297+
clust_scarcity = 15 * 15 * 15,
298+
clust_num_ores = 3,
299+
clust_size = 2,
300+
y_min = -255,
301+
y_max = -64,
302+
})
303+
304+
minetest.register_ore({
305+
ore_type = "scatter",
306+
ore = "default:stone_with_gold",
307+
wherein = "default:stone",
308+
clust_scarcity = 13 * 13 * 13,
309+
clust_num_ores = 5,
310+
clust_size = 3,
311+
y_min = -31000,
312+
y_max = -256,
313+
})
314+
315+
-- Mese crystal
316+
317+
minetest.register_ore({
318+
ore_type = "scatter",
319+
ore = "default:stone_with_mese",
320+
wherein = "default:stone",
321+
clust_scarcity = 14 * 14 * 14,
322+
clust_num_ores = 5,
323+
clust_size = 3,
324+
y_min = 1025,
325+
y_max = 31000,
326+
})
327+
328+
minetest.register_ore({
329+
ore_type = "scatter",
330+
ore = "default:stone_with_mese",
331+
wherein = "default:stone",
332+
clust_scarcity = 18 * 18 * 18,
333+
clust_num_ores = 3,
334+
clust_size = 2,
335+
y_min = -255,
336+
y_max = -64,
337+
})
338+
339+
minetest.register_ore({
340+
ore_type = "scatter",
341+
ore = "default:stone_with_mese",
342+
wherein = "default:stone",
343+
clust_scarcity = 14 * 14 * 14,
344+
clust_num_ores = 5,
345+
clust_size = 3,
346+
y_min = -31000,
347+
y_max = -256,
348+
})
349+
350+
-- Diamond
351+
352+
minetest.register_ore({
353+
ore_type = "scatter",
354+
ore = "default:stone_with_diamond",
355+
wherein = "default:stone",
356+
clust_scarcity = 15 * 15 * 15,
357+
clust_num_ores = 4,
358+
clust_size = 3,
359+
y_min = 1025,
360+
y_max = 31000,
361+
})
362+
363+
minetest.register_ore({
364+
ore_type = "scatter",
365+
ore = "default:stone_with_diamond",
366+
wherein = "default:stone",
367+
clust_scarcity = 17 * 17 * 17,
368+
clust_num_ores = 4,
369+
clust_size = 3,
370+
y_min = -255,
371+
y_max = -128,
372+
})
373+
374+
minetest.register_ore({
375+
ore_type = "scatter",
376+
ore = "default:stone_with_diamond",
377+
wherein = "default:stone",
378+
clust_scarcity = 15 * 15 * 15,
379+
clust_num_ores = 4,
380+
clust_size = 3,
381+
y_min = -31000,
382+
y_max = -256,
383+
})
384+
385+
-- Mese block
386+
387+
minetest.register_ore({
388+
ore_type = "scatter",
389+
ore = "default:mese",
390+
wherein = "default:stone",
391+
clust_scarcity = 36 * 36 * 36,
392+
clust_num_ores = 3,
393+
clust_size = 2,
394+
y_min = 1025,
395+
y_max = 31000,
396+
})
397+
398+
minetest.register_ore({
399+
ore_type = "scatter",
400+
ore = "default:mese",
401+
wherein = "default:stone",
402+
clust_scarcity = 36 * 36 * 36,
403+
clust_num_ores = 3,
404+
clust_size = 2,
405+
y_min = -31000,
406+
y_max = -1024,
407+
})
137408
end
138409

139410

140411
-- All mapgens except mgv6
141412

142-
function default.register_blob_ores()
413+
function default.register_ores()
414+
415+
-- Blob ore
416+
-- These first to avoid other ores in blobs
143417

144418
-- Clay
419+
-- This first to avoid clay in sand blobs
145420

146421
minetest.register_ore({
147422
ore_type = "blob",
@@ -246,13 +521,8 @@ function default.register_blob_ores()
246521
"floatland_grassland", "floatland_grassland_ocean",
247522
"floatland_coniferous_forest", "floatland_coniferous_forest_ocean"}
248523
})
249-
end
250524

251-
252-
-- Scatter ores
253-
-- All mapgens
254-
255-
function default.register_ores()
525+
-- Scatter ores
256526

257527
-- Coal
258528

@@ -1853,20 +2123,17 @@ minetest.clear_registered_decorations()
18532123

18542124
local mg_name = minetest.get_mapgen_setting("mg_name")
18552125
if mg_name == "v6" then
1856-
default.register_mgv6_blob_ores()
1857-
default.register_ores()
2126+
default.register_mgv6_ores()
18582127
default.register_mgv6_decorations()
18592128
elseif mg_name == "v7" and captures_float == "floatlands" and
18602129
captures_nofloat ~= "nofloatlands" then
18612130
-- Mgv7 with floatlands
18622131
default.register_biomes(mgv7_shadow_limit - 1)
18632132
default.register_floatland_biomes(mgv7_floatland_level, mgv7_shadow_limit)
1864-
default.register_blob_ores()
18652133
default.register_ores()
18662134
default.register_decorations()
18672135
else
18682136
default.register_biomes(31000)
1869-
default.register_blob_ores()
18702137
default.register_ores()
18712138
default.register_decorations()
18722139
end

0 commit comments

Comments
 (0)
Please sign in to comment.