mirror of
git://repo.or.cz/rocks.git
synced 2024-11-15 23:10:40 +01:00
Added ore chance.
This commit is contained in:
parent
d2b4bd6332
commit
8a44c3a8cd
|
@ -15,8 +15,8 @@ rocks.register_vein("clay",{
|
|||
hmin=-8, hmax=nil,
|
||||
layers={ "mudstone" },
|
||||
})
|
||||
rocks.register_ore( "clay", "default:clay", {treshold=0, chance=1 } )
|
||||
rocks.register_ore( "clay", "default:torch", {treshold=0, chance=0.3 } )
|
||||
rocks.register_ore( "clay", "default:clay", {treshold=0, chance=85 } )
|
||||
rocks.register_ore( "clay", "default:torch", {treshold=0, chance=15 } )
|
||||
|
||||
-- Breccia Mixture soft in mudstone
|
||||
-- Conglomerate Sed soft in mudstone
|
||||
|
|
15
mapgen.lua
15
mapgen.lua
|
@ -37,7 +37,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||
-- noise pre vein
|
||||
np=vd.np
|
||||
vd.nmap=minetest.get_perlin_map(np,map_lengths_xyz):get3dMap_flat(minp)
|
||||
vd.prng=nil
|
||||
vd.prng=PseudoRandom(np.seed)
|
||||
vd.sum=0
|
||||
for i,ore in pairs(vd.ores) do
|
||||
-- contntid pre rudu
|
||||
|
@ -93,9 +93,13 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||
|
||||
if vein then
|
||||
--* select ore
|
||||
local chance=vein.prng:next(0,vein.sum)
|
||||
for i,ore in pairs(vein.ores) do
|
||||
rock=ore
|
||||
break
|
||||
chance=chance-ore.chance
|
||||
if chance<=0 then
|
||||
rock=ore
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -111,8 +115,9 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||
end
|
||||
end
|
||||
manipulator:set_data(nodes)
|
||||
manipulator:calc_lighting()
|
||||
manipulator:update_liquids()
|
||||
--manipulator:calc_lighting()
|
||||
--manipulator:set_lighting({day=15,night=15})
|
||||
--manipulator:update_liquids()
|
||||
manipulator:write_to_map()
|
||||
print("[rocks] gen0 "..os.clock()-timebefore)
|
||||
end)
|
||||
|
|
Loading…
Reference in New Issue
Block a user