1
0
mirror of git://repo.or.cz/rocks.git synced 2024-11-18 00:08:35 +01:00

Re-enabled igneous formations and nyancat test vein.

This commit is contained in:
Tomáš Brada 2015-04-19 12:19:02 +02:00
parent 0fde0e8f15
commit 093310ed4b
2 changed files with 45 additions and 25 deletions

68
ign.lua
View File

@ -2,24 +2,6 @@
-- Igneous Layer -- Igneous Layer
-- --
local ign={
name="ign",
top={
offset = -10, scale = 0,
spread = {x=80, y=80, z=80},
octaves = 0, persist = 0 },
bot={
offset = -180, scale = 10, seed=rocksl.GetNextSeed(),
spread = {x=80, y=80, z=80},
octaves = 2, persist = 0.7 },
primary={ name="rocks:basalt" },
localized={},
stats={ count=0, total=0, node={}, totalnodes=0 },
debugging=nil
}
rocks.layer_initialize(ign)
-- Basalt Ex/Mafic hard same as diorite, byt limit=0.5 -- Basalt Ex/Mafic hard same as diorite, byt limit=0.5
minetest.register_node( "rocks:basalt", { minetest.register_node( "rocks:basalt", {
description = S("Basalt"), description = S("Basalt"),
@ -27,6 +9,10 @@ minetest.register_node( "rocks:basalt", {
groups = {cracky=3, stone=1}, groups = {cracky=3, stone=1},
is_ground_content = true, sounds = default.node_sound_stone_defaults(), is_ground_content = true, sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_alias("mapgen_stone", "rocks:basalt")
-- ^ does not work. Seems we can not overwrite an alias.
-- If the alias in default/mapgen.lua is deleted, this works.
-- more rock defs -- more rock defs
minetest.register_node( "rocks:granite", { minetest.register_node( "rocks:granite", {
@ -49,7 +35,22 @@ minetest.register_node( "rocks:gabbro", {
}) })
local reg=function(name,param) local reg=function(name,param)
rocksl.register_stratus(ign,name,param) minetest.register_ore({
ore = name,
wherein= { "mapgen_stone" },
ore_type = "scatter",
clust_scarcity = 10^3,
clust_num_ores = 20^3,
clust_size = 20,
height_min = -31000,
height_max = -5,
noise_treshhold=param.treshold,
noise_params={
offset = 0, scale = 1, octaves = 3, persist = 0.5,
spread = {x=param.spread, y=param.height, z=param.spread},
seed=rocksl.GetNextSeed(),
},
})
end end
rocks.register_igneous_stratus=reg rocks.register_igneous_stratus=reg
@ -59,16 +60,35 @@ rocks.register_igneous_stratus=reg
reg("rocks:gabbro", { spread=40, height=32, treshold=0.36}) reg("rocks:gabbro", { spread=40, height=32, treshold=0.36})
-- vein stuff -- vein stuff
ign.veins={}
local regv=rocks.register_vein local regv=function(name,param)
minetest.log("error","stub called, rocks.register_vein")
minetest.register_ore({
ore = name,
wherein= param.wherein,
ore_type = "blob",
clust_scarcity = param.rarity^3,
clust_num_ores = 8,
clust_size = 10*2,
height_min = -31000,
height_max = 50,
noise_threshhold = 0.5, --< determined experimentally
noise_params={
offset = 1-param.radius.amplitude, scale = param.radius.amplitude, octaves = 3, persist = 0.5,
spread = {x=param.radius.frequency, y=param.radius.frequency, z=param.radius.frequency},
seed=rocksl.GetNextSeed(),
},
})
end
rocks.register_vein=regv
rocks.register_vein("default:nyancat",{ rocks.register_vein("default:nyancat",{
wherein={"rocks:granite"}, wherein={"rocks:granite", "air"},
miny=-160, maxy=20, miny=-160, maxy=20,
radius={ average=10, amplitude=4, frequency=8 }, radius={ average=10, amplitude=0.1, frequency=8 },
density=100, density=100,
rarity=0.0025, -- this^3*mapblock_volume veins per mapblock rarity=70, -- this^3*mapblock_volume veins per mapblock
ores={ ores={
{ ore="default:sand", percent=30 }, { ore="default:sand", percent=30 },
{ ore="default:dirt", percent=30 }, { ore="default:dirt", percent=30 },

View File

@ -25,7 +25,7 @@ end
local modpath=minetest.get_modpath(minetest.get_current_modname()) local modpath=minetest.get_modpath(minetest.get_current_modname())
dofile(modpath.."/sed.lua") dofile(modpath.."/sed.lua")
--dofile(modpath.."/ign.lua") dofile(modpath.."/ign.lua")
--dofile(modpath.."/skarn.lua") --dofile(modpath.."/skarn.lua")
minetest.register_on_mapgen_init(function(mapgen_params) minetest.register_on_mapgen_init(function(mapgen_params)