Tweak spawn values in sedimentary layer.
[rocks.git] / ign.lua
blobc81663c1914393f17d34dcc616b799886b8813b0
1 --
2 -- Igneous Layer
3 --
5 local ign={
6 top={
7 offset = -10, scale = 0,
8 spread = {x=80, y=80, z=80},
9 octaves = 0, persist = 0 },
10 bot={
11 offset = -180, scale = 10, seed=rocksl.GetNextSeed(),
12 spread = {x=80, y=80, z=80},
13 octaves = 2, persist = 0.7 },
14 primary={ name="rocks:basalt" },
15 localized={},
16 stats={ count=0, total=0, node={}, totalnodes=0 },
17 debugging=nil
20 -- Basalt Ex/Mafic hard same as diorite, byt limit=0.5
21 minetest.register_node( "rocks:basalt", {
22 description = S("Basalt"),
23 tiles = { "rocks_Basalt.png" },
24 groups = {cracky=3, stone=1},
25 is_ground_content = true, sounds = default.node_sound_stone_defaults(),
28 -- more rock defs
29 minetest.register_node( "rocks:granite", {
30 description = S("Granite"),
31 tiles = { "rocks_Granite.png" },
32 is_ground_content = true, sounds = default.node_sound_stone_defaults(),
33 groups = {cracky=3, stone=1},
35 minetest.register_node( "rocks:diorite", {
36 description = S("Diorite"),
37 tiles = { "rocks_Diorite.png" },
38 groups = {cracky=3, stone=1},
39 is_ground_content = true, sounds = default.node_sound_stone_defaults(),
41 minetest.register_node( "rocks:gabbro", {
42 description = S("Gabbro"),
43 tiles = { "rocks_Gabbro.png" },
44 groups = {cracky=3, stone=1},
45 is_ground_content = true, sounds = default.node_sound_stone_defaults(),
48 local reg=function(name,param)
49 rocksl.register_stratus(ign,name,param)
50 end
51 rocks.register_igneous_stratus=reg
53 -- rock registration
54 reg("rocks:granite", { spread=40, height=32, treshold=0.06})
55 reg("rocks:diorite", { spread=40, height=32, treshold=0.23})
56 reg("rocks:gabbro", { spread=40, height=32, treshold=0.36})
58 -- vein stuff
59 ign.veins={}
61 local regv=function(name,param)
62 rocksl.register_vein(ign.veins,name,param)
63 end
64 rocks.register_vein=regv
66 rocks.register_vein("default:nyancat",{
67 wherein={"rocks:granite"},
68 miny=-160, maxy=20,
69 radius={ average=10, amplitude=4, frequency=8 },
70 density=100,
71 rarity=0.0025, -- this^3*mapblock_volume veins per mapblock
72 ores={
73 { ore="default:sand", percent=30 },
74 { ore="default:dirt", percent=30 },
79 minetest.register_on_generated(function(minp, maxp, seed)
80 rocksl.layergen(ign,minp,maxp,seed)
81 rocksl.veingen(ign.veins,minp,maxp,seed)
82 end)
84 minetest.register_on_shutdown(function()
85 if (ign.stats.count==0) then rocksl.print("[rocks](ign) stats not available, no chunks generated") return end
86 rocksl.print("[rocks](ign) generated total "..ign.stats.count.." chunks in "..ign.stats.total.." seconds ("..(ign.stats.total/ign.stats.count).." seconds per "..ign.stats.side.."^3 chunk)")
87 for name,total in pairs(ign.stats.node) do
88 rocksl.print("[rocks](ign) "..name..": "..total.." nodes placed ("..(total*100)/(ign.stats.totalnodes).." %)")
89 end
90 end)
92 -- ~ Tomas Brod