2015-04-02 00:35:35 +02:00
--
-- Igneous Layer
--
2015-04-02 20:17:56 +02:00
local ign = {
2015-04-02 00:35:35 +02:00
top = {
2015-04-02 20:17:56 +02:00
offset = - 10 , scale = 0 ,
2015-04-02 00:35:35 +02:00
spread = { x = 80 , y = 80 , z = 80 } ,
octaves = 0 , persist = 0 } ,
bot = {
2015-04-02 20:17:56 +02:00
offset = - 180 , scale = 10 , seed = rocksl.GetNextSeed ( ) ,
2015-04-02 00:35:35 +02:00
spread = { x = 80 , y = 80 , z = 80 } ,
octaves = 2 , persist = 0.7 } ,
primary = { name = " rocks:basalt " } ,
localized = { } ,
2015-04-02 20:17:56 +02:00
stats = { count = 0 , total = 0 , node = { } , totalnodes = 0 } ,
2015-04-02 21:14:05 +02:00
debugging = nil
2015-04-02 00:35:35 +02:00
}
2015-04-02 20:17:56 +02:00
-- Basalt Ex/Mafic hard same as diorite, byt limit=0.5
minetest.register_node ( " rocks:basalt " , {
description = S ( " Basalt " ) ,
tiles = { " rocks_Basalt.png " } ,
groups = { cracky = 3 , stone = 1 } ,
is_ground_content = true , sounds = default.node_sound_stone_defaults ( ) ,
} )
2015-04-02 00:35:35 +02:00
2015-04-02 20:17:56 +02:00
-- more rock defs
minetest.register_node ( " rocks:granite " , {
description = S ( " Granite " ) ,
tiles = { " rocks_Granite.png " } ,
is_ground_content = true , sounds = default.node_sound_stone_defaults ( ) ,
groups = { cracky = 3 , stone = 1 } ,
} )
minetest.register_node ( " rocks:diorite " , {
description = S ( " Diorite " ) ,
tiles = { " rocks_Diorite.png " } ,
groups = { cracky = 3 , stone = 1 } ,
is_ground_content = true , sounds = default.node_sound_stone_defaults ( ) ,
} )
minetest.register_node ( " rocks:gabbro " , {
description = S ( " Gabbro " ) ,
tiles = { " rocks_Gabbro.png " } ,
groups = { cracky = 3 , stone = 1 } ,
is_ground_content = true , sounds = default.node_sound_stone_defaults ( ) ,
} )
2015-04-02 00:35:35 +02:00
local reg = function ( name , param )
2015-04-04 00:10:37 +02:00
rocksl.register_stratus ( ign , name , param )
2015-04-02 00:35:35 +02:00
end
2015-04-04 00:10:37 +02:00
rocks.register_igneous_stratus = reg
2015-04-02 00:35:35 +02:00
-- rock registration
2015-04-03 16:06:45 +02:00
reg ( " rocks:granite " , { spread = 40 , height = 32 , treshold = 0.06 } )
reg ( " rocks:diorite " , { spread = 40 , height = 32 , treshold = 0.23 } )
reg ( " rocks:gabbro " , { spread = 40 , height = 32 , treshold = 0.36 } )
2015-04-02 00:35:35 +02:00
2015-04-03 21:32:20 +02:00
-- vein stuff
2015-04-04 00:10:37 +02:00
ign.veins = { }
2015-04-10 19:30:36 +02:00
local regv = function ( name , param )
rocksl.register_vein ( ign.veins , name , param )
end
rocks.register_vein = regv
rocks.register_vein ( " default:nyancat " , {
2015-04-12 12:04:13 +02:00
wherein = { " rocks:granite " } ,
2015-04-04 00:10:37 +02:00
miny =- 160 , maxy = 20 ,
radius = { average = 10 , amplitude = 4 , frequency = 8 } ,
2015-04-10 19:30:36 +02:00
density = 100 ,
rarity = 0.0025 , -- this^3*mapblock_volume veins per mapblock
2015-04-10 16:58:33 +02:00
ores = {
{ ore = " default:sand " , percent = 30 } ,
{ ore = " default:dirt " , percent = 30 } ,
}
2015-04-04 00:10:37 +02:00
} )
2015-04-03 21:32:20 +02:00
2015-04-02 00:35:35 +02:00
minetest.register_on_generated ( function ( minp , maxp , seed )
2015-04-02 20:17:56 +02:00
rocksl.layergen ( ign , minp , maxp , seed )
2015-04-04 00:10:37 +02:00
rocksl.veingen ( ign.veins , minp , maxp , seed )
2015-04-02 00:35:35 +02:00
end )
minetest.register_on_shutdown ( function ( )
2015-04-03 15:48:49 +02:00
if ( ign.stats . count == 0 ) then rocksl.print ( " [rocks](ign) stats not available, no chunks generated " ) return end
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) " )
2015-04-02 20:17:56 +02:00
for name , total in pairs ( ign.stats . node ) do
2015-04-03 15:48:49 +02:00
rocksl.print ( " [rocks](ign) " .. name .. " : " .. total .. " nodes placed ( " .. ( total * 100 ) / ( ign.stats . totalnodes ) .. " %) " )
2015-04-02 00:35:35 +02:00
end
end )
-- ~ Tomas Brod