Re-enabled igneous formations and nyancat test vein.
[rocks.git] / ign.lua
bloba3c221c41bf57fa2b4dc601b39bb36821e51042a
1 --
2 -- Igneous Layer
3 --
5 -- Basalt Ex/Mafic hard same as diorite, byt limit=0.5
6 minetest.register_node( "rocks:basalt", {
7 description = S("Basalt"),
8 tiles = { "rocks_Basalt.png" },
9 groups = {cracky=3, stone=1},
10 is_ground_content = true, sounds = default.node_sound_stone_defaults(),
12 minetest.register_alias("mapgen_stone", "rocks:basalt")
14 -- ^ does not work. Seems we can not overwrite an alias.
15 -- If the alias in default/mapgen.lua is deleted, this works.
17 -- more rock defs
18 minetest.register_node( "rocks:granite", {
19 description = S("Granite"),
20 tiles = { "rocks_Granite.png" },
21 is_ground_content = true, sounds = default.node_sound_stone_defaults(),
22 groups = {cracky=3, stone=1},
24 minetest.register_node( "rocks:diorite", {
25 description = S("Diorite"),
26 tiles = { "rocks_Diorite.png" },
27 groups = {cracky=3, stone=1},
28 is_ground_content = true, sounds = default.node_sound_stone_defaults(),
30 minetest.register_node( "rocks:gabbro", {
31 description = S("Gabbro"),
32 tiles = { "rocks_Gabbro.png" },
33 groups = {cracky=3, stone=1},
34 is_ground_content = true, sounds = default.node_sound_stone_defaults(),
37 local reg=function(name,param)
38 minetest.register_ore({
39 ore = name,
40 wherein= { "mapgen_stone" },
41 ore_type = "scatter",
42 clust_scarcity = 10^3,
43 clust_num_ores = 20^3,
44 clust_size = 20,
45 height_min = -31000,
46 height_max = -5,
47 noise_treshhold=param.treshold,
48 noise_params={
49 offset = 0, scale = 1, octaves = 3, persist = 0.5,
50 spread = {x=param.spread, y=param.height, z=param.spread},
51 seed=rocksl.GetNextSeed(),
54 end
55 rocks.register_igneous_stratus=reg
57 -- rock registration
58 reg("rocks:granite", { spread=40, height=32, treshold=0.06})
59 reg("rocks:diorite", { spread=40, height=32, treshold=0.23})
60 reg("rocks:gabbro", { spread=40, height=32, treshold=0.36})
62 -- vein stuff
64 local regv=function(name,param)
65 minetest.log("error","stub called, rocks.register_vein")
66 minetest.register_ore({
67 ore = name,
68 wherein= param.wherein,
69 ore_type = "blob",
70 clust_scarcity = param.rarity^3,
71 clust_num_ores = 8,
72 clust_size = 10*2,
73 height_min = -31000,
74 height_max = 50,
75 noise_threshhold = 0.5, --< determined experimentally
76 noise_params={
77 offset = 1-param.radius.amplitude, scale = param.radius.amplitude, octaves = 3, persist = 0.5,
78 spread = {x=param.radius.frequency, y=param.radius.frequency, z=param.radius.frequency},
79 seed=rocksl.GetNextSeed(),
82 end
84 rocks.register_vein=regv
86 rocks.register_vein("default:nyancat",{
87 wherein={"rocks:granite", "air"},
88 miny=-160, maxy=20,
89 radius={ average=10, amplitude=0.1, frequency=8 },
90 density=100,
91 rarity=70, -- this^3*mapblock_volume veins per mapblock
92 ores={
93 { ore="default:sand", percent=30 },
94 { ore="default:dirt", percent=30 },
99 -- ~ Tomas Brod