1
0
Fork 0

Spawn fossils in fixed height range

objects
Wuzzy 2017-09-08 05:49:24 +02:00
parent 152327bb2a
commit 237541789b
1 changed files with 2 additions and 2 deletions

View File

@ -1050,8 +1050,8 @@ minetest.register_on_generated(function(minp, maxp, seed)
local fossil_prob = 64 * (((maxp.x-minp.x+1)*(maxp.z-minp.z+1)) / 256) local fossil_prob = 64 * (((maxp.x-minp.x+1)*(maxp.z-minp.z+1)) / 256)
if math.random(1, fossil_prob) == 1 then if math.random(1, fossil_prob) == 1 then
-- Spawn fossil below desert surface -- Spawn fossil below desert surface between layers 40 and 49
local p1 = {x=p.x, y=p.y-math.random(15, 24), z=p.z} local p1 = {x=p.x, y=math.random(mcl_util.layer_to_y(40), mcl_util.layer_to_y(49)), z=p.z}
-- Very rough check of the environment (we expect to have enough stonelike nodes). -- Very rough check of the environment (we expect to have enough stonelike nodes).
-- Fossils may still appear partially exposed in caves, but this is O.K. -- Fossils may still appear partially exposed in caves, but this is O.K.
local p2 = vector.add(p1, 4) local p2 = vector.add(p1, 4)