Skip to content

Commit 3b526a7

Browse files
committedFeb 22, 2015
mapgen.lua: Add dirt/sand/gravel blob ores for mgv5/mgv7
Create register ores function. Select and order functions per mapgen Use blob ore for clay. Update ore height_min/max to y_min/max Tune flower amount
1 parent 03c00a8 commit 3b526a7

File tree

1 file changed

+313
-236
lines changed

1 file changed

+313
-236
lines changed
 

Diff for: ‎mods/default/mapgen.lua

+313-236
Original file line numberDiff line numberDiff line change
@@ -31,192 +31,203 @@ minetest.register_alias("mapgen_stair_cobble", "stairs:stair_cobble")
3131
-- Ore generation
3232
--
3333

34-
minetest.register_ore({
35-
ore_type = "scatter",
36-
ore = "default:stone_with_coal",
37-
wherein = "default:stone",
38-
clust_scarcity = 8*8*8,
39-
clust_num_ores = 8,
40-
clust_size = 3,
41-
height_min = -31000,
42-
height_max = 64,
43-
})
44-
45-
minetest.register_ore({
46-
ore_type = "scatter",
47-
ore = "default:stone_with_coal",
48-
wherein = "default:stone",
49-
clust_scarcity = 24*24*24,
50-
clust_num_ores = 27,
51-
clust_size = 6,
52-
height_min = -31000,
53-
height_max = 0,
54-
flags = "absheight",
55-
})
56-
57-
minetest.register_ore({
58-
ore_type = "scatter",
59-
ore = "default:stone_with_iron",
60-
wherein = "default:stone",
61-
clust_scarcity = 12*12*12,
62-
clust_num_ores = 3,
63-
clust_size = 2,
64-
height_min = -15,
65-
height_max = 2,
66-
})
67-
68-
minetest.register_ore({
69-
ore_type = "scatter",
70-
ore = "default:stone_with_iron",
71-
wherein = "default:stone",
72-
clust_scarcity = 9*9*9,
73-
clust_num_ores = 5,
74-
clust_size = 3,
75-
height_min = -63,
76-
height_max = -16,
77-
})
78-
79-
minetest.register_ore({
80-
ore_type = "scatter",
81-
ore = "default:stone_with_iron",
82-
wherein = "default:stone",
83-
clust_scarcity = 7*7*7,
84-
clust_num_ores = 5,
85-
clust_size = 3,
86-
height_min = -31000,
87-
height_max = -64,
88-
flags = "absheight",
89-
})
90-
91-
minetest.register_ore({
92-
ore_type = "scatter",
93-
ore = "default:stone_with_iron",
94-
wherein = "default:stone",
95-
clust_scarcity = 24*24*24,
96-
clust_num_ores = 27,
97-
clust_size = 6,
98-
height_min = -31000,
99-
height_max = -64,
100-
flags = "absheight",
101-
})
102-
103-
minetest.register_ore({
104-
ore_type = "scatter",
105-
ore = "default:stone_with_mese",
106-
wherein = "default:stone",
107-
clust_scarcity = 18*18*18,
108-
clust_num_ores = 3,
109-
clust_size = 2,
110-
height_min = -255,
111-
height_max = -64,
112-
flags = "absheight",
113-
})
114-
115-
minetest.register_ore({
116-
ore_type = "scatter",
117-
ore = "default:stone_with_mese",
118-
wherein = "default:stone",
119-
clust_scarcity = 14*14*14,
120-
clust_num_ores = 5,
121-
clust_size = 3,
122-
height_min = -31000,
123-
height_max = -256,
124-
flags = "absheight",
125-
})
126-
127-
minetest.register_ore({
128-
ore_type = "scatter",
129-
ore = "default:mese",
130-
wherein = "default:stone",
131-
clust_scarcity = 36*36*36,
132-
clust_num_ores = 3,
133-
clust_size = 2,
134-
height_min = -31000,
135-
height_max = -1024,
136-
flags = "absheight",
137-
})
138-
139-
minetest.register_ore({
140-
ore_type = "scatter",
141-
ore = "default:stone_with_gold",
142-
wherein = "default:stone",
143-
clust_scarcity = 15*15*15,
144-
clust_num_ores = 3,
145-
clust_size = 2,
146-
height_min = -255,
147-
height_max = -64,
148-
flags = "absheight",
149-
})
150-
151-
minetest.register_ore({
152-
ore_type = "scatter",
153-
ore = "default:stone_with_gold",
154-
wherein = "default:stone",
155-
clust_scarcity = 13*13*13,
156-
clust_num_ores = 5,
157-
clust_size = 3,
158-
height_min = -31000,
159-
height_max = -256,
160-
flags = "absheight",
161-
})
162-
163-
minetest.register_ore({
164-
ore_type = "scatter",
165-
ore = "default:stone_with_diamond",
166-
wherein = "default:stone",
167-
clust_scarcity = 17*17*17,
168-
clust_num_ores = 4,
169-
clust_size = 3,
170-
height_min = -255,
171-
height_max = -128,
172-
flags = "absheight",
173-
})
174-
175-
minetest.register_ore({
176-
ore_type = "scatter",
177-
ore = "default:stone_with_diamond",
178-
wherein = "default:stone",
179-
clust_scarcity = 15*15*15,
180-
clust_num_ores = 4,
181-
clust_size = 3,
182-
height_min = -31000,
183-
height_max = -256,
184-
flags = "absheight",
185-
})
186-
187-
minetest.register_ore({
188-
ore_type = "scatter",
189-
ore = "default:stone_with_copper",
190-
wherein = "default:stone",
191-
clust_scarcity = 12*12*12,
192-
clust_num_ores = 4,
193-
clust_size = 3,
194-
height_min = -63,
195-
height_max = -16,
196-
})
197-
198-
minetest.register_ore({
199-
ore_type = "scatter",
200-
ore = "default:stone_with_copper",
201-
wherein = "default:stone",
202-
clust_scarcity = 9*9*9,
203-
clust_num_ores = 5,
204-
clust_size = 3,
205-
height_min = -31000,
206-
height_max = -64,
207-
flags = "absheight",
208-
})
209-
210-
minetest.register_ore({
211-
ore_type = "scatter",
212-
ore = "default:clay",
213-
wherein = "default:sand",
214-
clust_scarcity = 15*15*15,
215-
clust_num_ores = 64,
216-
clust_size = 5,
217-
height_max = 0,
218-
height_min = -10,
219-
})
34+
function default.register_ores()
35+
minetest.register_ore({
36+
ore_type = "scatter",
37+
ore = "default:stone_with_coal",
38+
wherein = "default:stone",
39+
clust_scarcity = 8*8*8,
40+
clust_num_ores = 8,
41+
clust_size = 3,
42+
y_min = -31000,
43+
y_max = 64,
44+
})
45+
46+
minetest.register_ore({
47+
ore_type = "scatter",
48+
ore = "default:stone_with_coal",
49+
wherein = "default:stone",
50+
clust_scarcity = 24*24*24,
51+
clust_num_ores = 27,
52+
clust_size = 6,
53+
y_min = -31000,
54+
y_max = 0,
55+
flags = "absheight",
56+
})
57+
58+
minetest.register_ore({
59+
ore_type = "scatter",
60+
ore = "default:stone_with_iron",
61+
wherein = "default:stone",
62+
clust_scarcity = 12*12*12,
63+
clust_num_ores = 3,
64+
clust_size = 2,
65+
y_min = -15,
66+
y_max = 2,
67+
})
68+
69+
minetest.register_ore({
70+
ore_type = "scatter",
71+
ore = "default:stone_with_iron",
72+
wherein = "default:stone",
73+
clust_scarcity = 9*9*9,
74+
clust_num_ores = 5,
75+
clust_size = 3,
76+
y_min = -63,
77+
y_max = -16,
78+
})
79+
80+
minetest.register_ore({
81+
ore_type = "scatter",
82+
ore = "default:stone_with_iron",
83+
wherein = "default:stone",
84+
clust_scarcity = 7*7*7,
85+
clust_num_ores = 5,
86+
clust_size = 3,
87+
y_min = -31000,
88+
y_max = -64,
89+
flags = "absheight",
90+
})
91+
92+
minetest.register_ore({
93+
ore_type = "scatter",
94+
ore = "default:stone_with_iron",
95+
wherein = "default:stone",
96+
clust_scarcity = 24*24*24,
97+
clust_num_ores = 27,
98+
clust_size = 6,
99+
y_min = -31000,
100+
y_max = -64,
101+
flags = "absheight",
102+
})
103+
104+
minetest.register_ore({
105+
ore_type = "scatter",
106+
ore = "default:stone_with_mese",
107+
wherein = "default:stone",
108+
clust_scarcity = 18*18*18,
109+
clust_num_ores = 3,
110+
clust_size = 2,
111+
y_min = -255,
112+
y_max = -64,
113+
flags = "absheight",
114+
})
115+
116+
minetest.register_ore({
117+
ore_type = "scatter",
118+
ore = "default:stone_with_mese",
119+
wherein = "default:stone",
120+
clust_scarcity = 14*14*14,
121+
clust_num_ores = 5,
122+
clust_size = 3,
123+
y_min = -31000,
124+
y_max = -256,
125+
flags = "absheight",
126+
})
127+
128+
minetest.register_ore({
129+
ore_type = "scatter",
130+
ore = "default:mese",
131+
wherein = "default:stone",
132+
clust_scarcity = 36*36*36,
133+
clust_num_ores = 3,
134+
clust_size = 2,
135+
y_min = -31000,
136+
y_max = -1024,
137+
flags = "absheight",
138+
})
139+
140+
minetest.register_ore({
141+
ore_type = "scatter",
142+
ore = "default:stone_with_gold",
143+
wherein = "default:stone",
144+
clust_scarcity = 15*15*15,
145+
clust_num_ores = 3,
146+
clust_size = 2,
147+
y_min = -255,
148+
y_max = -64,
149+
flags = "absheight",
150+
})
151+
152+
minetest.register_ore({
153+
ore_type = "scatter",
154+
ore = "default:stone_with_gold",
155+
wherein = "default:stone",
156+
clust_scarcity = 13*13*13,
157+
clust_num_ores = 5,
158+
clust_size = 3,
159+
y_min = -31000,
160+
y_max = -256,
161+
flags = "absheight",
162+
})
163+
164+
minetest.register_ore({
165+
ore_type = "scatter",
166+
ore = "default:stone_with_diamond",
167+
wherein = "default:stone",
168+
clust_scarcity = 17*17*17,
169+
clust_num_ores = 4,
170+
clust_size = 3,
171+
y_min = -255,
172+
y_max = -128,
173+
flags = "absheight",
174+
})
175+
176+
minetest.register_ore({
177+
ore_type = "scatter",
178+
ore = "default:stone_with_diamond",
179+
wherein = "default:stone",
180+
clust_scarcity = 15*15*15,
181+
clust_num_ores = 4,
182+
clust_size = 3,
183+
y_min = -31000,
184+
y_max = -256,
185+
flags = "absheight",
186+
})
187+
188+
minetest.register_ore({
189+
ore_type = "scatter",
190+
ore = "default:stone_with_copper",
191+
wherein = "default:stone",
192+
clust_scarcity = 12*12*12,
193+
clust_num_ores = 4,
194+
clust_size = 3,
195+
y_min = -63,
196+
y_max = -16,
197+
})
198+
199+
minetest.register_ore({
200+
ore_type = "scatter",
201+
ore = "default:stone_with_copper",
202+
wherein = "default:stone",
203+
clust_scarcity = 9*9*9,
204+
clust_num_ores = 5,
205+
clust_size = 3,
206+
y_min = -31000,
207+
y_max = -64,
208+
flags = "absheight",
209+
})
210+
211+
minetest.register_ore({
212+
ore_type = "blob",
213+
ore = "default:clay",
214+
wherein = {"default:sand"},
215+
clust_scarcity = 24*24*24,
216+
clust_size = 7,
217+
y_min = -10,
218+
y_max = 0,
219+
noise_threshhold = 0,
220+
noise_params = {
221+
offset=0.35,
222+
scale=0.2,
223+
spread={x=5, y=5, z=5},
224+
seed=-316,
225+
octaves=1,
226+
persist=0.5
227+
},
228+
})
229+
end
230+
220231

221232
function default.generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, height_min, height_max)
222233
minetest.log('action', "WARNING: default.generate_ore is deprecated")
@@ -433,6 +444,7 @@ function default.make_nyancat(pos, facedir, length)
433444
end
434445
end
435446

447+
436448
function default.generate_nyancats(minp, maxp, seed)
437449
local height_min = -31000
438450
local height_max = -32
@@ -455,18 +467,16 @@ function default.generate_nyancats(minp, maxp, seed)
455467
end
456468
end
457469

470+
458471
minetest.register_on_generated(default.generate_nyancats)
459472

460473
--
461474
-- Register biomes
462475
--
463476

464477
function default.register_biomes()
465-
466478
minetest.clear_registered_biomes()
467479

468-
-- Temperate biomes
469-
470480
minetest.register_biome({
471481
name = "grassland",
472482
node_top = "default:dirt_with_grass",
@@ -482,128 +492,126 @@ function default.register_biomes()
482492
--depth_water_top = ,
483493
--node_water = "",
484494
--node_dust = "",
485-
y_min = -32000,
486-
y_max = 32000,
495+
y_min = -31000,
496+
y_max = 31000,
487497
heat_point = 50,
488498
humidity_point = 50,
489499
})
490-
500+
491501
--
492502
-- Register decorations
493503
--
494-
495-
-- Grassland
496-
504+
497505
-- Flowers
498506

499507
minetest.register_decoration({
500508
deco_type = "simple",
501509
place_on = {"default:dirt_with_grass"},
502510
sidelen = 16,
503511
noise_params = {
504-
offset = -0.015,
512+
offset = -0.02,
505513
scale = 0.03,
506514
spread = {x=100, y=100, z=100},
507515
seed = 436,
508516
octaves = 3,
509517
persist = 0.6
510518
},
511519
biomes = {"grassland"},
512-
y_min = -32000,
513-
y_max = 32000,
520+
y_min = -31000,
521+
y_max = 31000,
514522
decoration = "flowers:rose",
515523
})
516-
524+
517525
minetest.register_decoration({
518526
deco_type = "simple",
519527
place_on = {"default:dirt_with_grass"},
520528
sidelen = 16,
521529
noise_params = {
522-
offset = -0.015,
530+
offset = -0.02,
523531
scale = 0.03,
524532
spread = {x=100, y=100, z=100},
525533
seed = 19822,
526534
octaves = 3,
527535
persist = 0.6
528536
},
529537
biomes = {"grassland"},
530-
y_min = -32000,
531-
y_max = 32000,
538+
y_min = -31000,
539+
y_max = 31000,
532540
decoration = "flowers:tulip",
533541
})
534-
542+
535543
minetest.register_decoration({
536544
deco_type = "simple",
537545
place_on = {"default:dirt_with_grass"},
538546
sidelen = 16,
539547
noise_params = {
540-
offset = -0.015,
548+
offset = -0.02,
541549
scale = 0.03,
542550
spread = {x=100, y=100, z=100},
543551
seed = 1220999,
544552
octaves = 3,
545553
persist = 0.6
546554
},
547555
biomes = {"grassland"},
548-
y_min = -32000,
549-
y_max = 32000,
556+
y_min = -31000,
557+
y_max = 31000,
550558
decoration = "flowers:dandelion_yellow",
551559
})
552-
560+
553561
minetest.register_decoration({
554562
deco_type = "simple",
555563
place_on = {"default:dirt_with_grass"},
556564
sidelen = 16,
557565
noise_params = {
558-
offset = -0.015,
566+
offset = -0.02,
559567
scale = 0.03,
560568
spread = {x=100, y=100, z=100},
561569
seed = 36662,
562570
octaves = 3,
563571
persist = 0.6
564572
},
565573
biomes = {"grassland"},
566-
y_min = -32000,
567-
y_max = 32000,
574+
y_min = -31000,
575+
y_max = 31000,
568576
decoration = "flowers:geranium",
569577
})
570-
578+
571579
minetest.register_decoration({
572580
deco_type = "simple",
573581
place_on = {"default:dirt_with_grass"},
574582
sidelen = 16,
575583
noise_params = {
576-
offset = -0.015,
584+
offset = -0.02,
577585
scale = 0.03,
578586
spread = {x=100, y=100, z=100},
579587
seed = 1133,
580588
octaves = 3,
581589
persist = 0.6
582590
},
583591
biomes = {"grassland"},
584-
y_min = -32000,
585-
y_max = 32000,
592+
y_min = -31000,
593+
y_max = 31000,
586594
decoration = "flowers:viola",
587595
})
588-
596+
589597
minetest.register_decoration({
590598
deco_type = "simple",
591599
place_on = {"default:dirt_with_grass"},
592600
sidelen = 16,
593601
noise_params = {
594-
offset = -0.015,
602+
offset = -0.02,
595603
scale = 0.03,
596604
spread = {x=100, y=100, z=100},
597605
seed = 73133,
598606
octaves = 3,
599607
persist = 0.6
600608
},
601609
biomes = {"grassland"},
602-
y_min = -32000,
603-
y_max = 32000,
610+
y_min = -31000,
611+
y_max = 31000,
604612
decoration = "flowers:dandelion_white",
605613
})
606-
614+
607615
-- Grasses
608616

609617
minetest.register_decoration({
@@ -619,11 +627,11 @@ function default.register_biomes()
619627
persist = 0.6
620628
},
621629
biomes = {"grassland"},
622-
y_min = -32000,
623-
y_max = 32000,
630+
y_min = -31000,
631+
y_max = 31000,
624632
decoration = "default:grass_1",
625633
})
626-
634+
627635
minetest.register_decoration({
628636
deco_type = "simple",
629637
place_on = {"default:dirt_with_grass"},
@@ -637,11 +645,11 @@ function default.register_biomes()
637645
persist = 0.6
638646
},
639647
biomes = {"grassland"},
640-
y_min = -32000,
641-
y_max = 32000,
648+
y_min = -31000,
649+
y_max = 31000,
642650
decoration = "default:grass_2",
643651
})
644-
652+
645653
minetest.register_decoration({
646654
deco_type = "simple",
647655
place_on = {"default:dirt_with_grass"},
@@ -655,11 +663,11 @@ function default.register_biomes()
655663
persist = 0.6
656664
},
657665
biomes = {"grassland"},
658-
y_min = -32000,
659-
y_max = 32000,
666+
y_min = -31000,
667+
y_max = 31000,
660668
decoration = "default:grass_3",
661669
})
662-
670+
663671
minetest.register_decoration({
664672
deco_type = "simple",
665673
place_on = {"default:dirt_with_grass"},
@@ -673,11 +681,11 @@ function default.register_biomes()
673681
persist = 0.6
674682
},
675683
biomes = {"grassland"},
676-
y_min = -32000,
677-
y_max = 32000,
684+
y_min = -31000,
685+
y_max = 31000,
678686
decoration = "default:grass_4",
679687
})
680-
688+
681689
minetest.register_decoration({
682690
deco_type = "simple",
683691
place_on = {"default:dirt_with_grass"},
@@ -691,21 +699,90 @@ function default.register_biomes()
691699
persist = 0.6
692700
},
693701
biomes = {"grassland"},
694-
y_min = -32000,
695-
y_max = 32000,
702+
y_min = -31000,
703+
y_max = 31000,
696704
decoration = "default:grass_5",
697705
})
698-
706+
end
707+
708+
--
709+
-- Register blob ore
710+
--
711+
712+
function default.register_blobs()
713+
minetest.register_ore({
714+
ore_type = "blob",
715+
ore = "default:sand",
716+
wherein = {"default:stone"},
717+
clust_scarcity = 24*24*24,
718+
clust_size = 7,
719+
y_min = -63,
720+
y_max = 4,
721+
noise_threshhold = 0,
722+
noise_params = {
723+
offset=0.35,
724+
scale=0.2,
725+
spread={x=5, y=5, z=5},
726+
seed=2316,
727+
octaves=1,
728+
persist=0.5
729+
},
730+
})
731+
732+
minetest.register_ore({
733+
ore_type = "blob",
734+
ore = "default:dirt",
735+
wherein = {"default:stone"},
736+
clust_scarcity = 24*24*24,
737+
clust_size = 7,
738+
y_min = -63,
739+
y_max = 31000,
740+
noise_threshhold = 0,
741+
noise_params = {
742+
offset=0.35,
743+
scale=0.2,
744+
spread={x=5, y=5, z=5},
745+
seed=17676,
746+
octaves=1,
747+
persist=0.5
748+
},
749+
})
750+
751+
minetest.register_ore({
752+
ore_type = "blob",
753+
ore = "default:gravel",
754+
wherein = {"default:stone"},
755+
clust_scarcity = 24*24*24,
756+
clust_size = 7,
757+
y_min = -31000,
758+
y_max = 31000,
759+
noise_threshhold = 0,
760+
noise_params = {
761+
offset=0.35,
762+
scale=0.2,
763+
spread={x=5, y=5, z=5},
764+
seed=766,
765+
octaves=1,
766+
persist=0.5
767+
},
768+
})
699769
end
700770

701771
--
702772
-- Detect mapgen and select suitable biome code
703773
--
704774

705775
local mg_params = minetest.get_mapgen_params()
706-
if mg_params.mgname == "v6" then
776+
if mg_params.mgname == "v5" then
777+
default.register_biomes()
778+
default.register_blobs()
779+
default.register_ores()
780+
elseif mg_params.mgname == "v6" then
707781
minetest.register_on_generated(default.mgv6_ongen)
708-
else
782+
default.register_ores()
783+
elseif mg_params.mgname == "v7" then
709784
default.register_biomes()
785+
default.register_blobs()
786+
default.register_ores()
710787
end
711788

0 commit comments

Comments
 (0)
Please sign in to comment.