mirror of
git://repo.or.cz/rocks.git
synced 2024-11-15 23:10:40 +01:00
Add vein density.
This commit is contained in:
parent
65f286f233
commit
bb7d89bf7d
11
ign.lua
11
ign.lua
|
@ -58,12 +58,17 @@ rocks.register_igneous_stratus=reg
|
|||
-- vein stuff
|
||||
ign.veins={}
|
||||
|
||||
rocksl.register_vein(ign.veins,"default:nyancat",{
|
||||
local regv=function(name,param)
|
||||
rocksl.register_vein(ign.veins,name,param)
|
||||
end
|
||||
rocks.register_vein=regv
|
||||
|
||||
rocks.register_vein("default:nyancat",{
|
||||
wherein="rocks:granite",
|
||||
miny=-160, maxy=20,
|
||||
radius={ average=10, amplitude=4, frequency=8 },
|
||||
density=1,
|
||||
rarity=0.025, -- this^3*mapblock_volume veins per mapblock
|
||||
density=100,
|
||||
rarity=0.0025, -- this^3*mapblock_volume veins per mapblock
|
||||
ores={
|
||||
{ ore="default:sand", percent=30 },
|
||||
{ ore="default:dirt", percent=30 },
|
||||
|
|
|
@ -157,7 +157,8 @@ rocksl.veingen=function(veins,minp,maxp,seed)
|
|||
local posc = {x=x+x0,y=y+y0,z=z+z0}
|
||||
posi = area:index(posc.x, posc.y, posc.z)
|
||||
local nv=noise[noise_ix]
|
||||
if ((x^2)+(y^2)+(z^2))<((vein.radius.average+nv)^2) then
|
||||
local luck=random:next(0,99)
|
||||
if (luck<vein.density) and (((x^2)+(y^2)+(z^2))<((vein.radius.average+nv)^2)) then
|
||||
nodes[posi]=primary_ctx
|
||||
local luck=random:next(0,99)
|
||||
for _,sec in pairs(vein.secondary) do
|
||||
|
|
Loading…
Reference in New Issue
Block a user