Tiefen und Höhen der Mods/Biome angepasst
This commit is contained in:
parent
ee3c9fbad6
commit
f7d9844d54
4 changed files with 18 additions and 14 deletions
|
@ -93,16 +93,20 @@ local function generate(minp, maxp, seed)
|
|||
|
||||
local y_min = math.max(minp.y, height_min)
|
||||
local y_max = math.min(maxp.y, height_max)
|
||||
local volume = (maxp.x - minp.x + 1) * (y_max - y_min + 1) * (maxp.z - minp.z + 1)
|
||||
local pr = PseudoRandom(seed + 9324342)
|
||||
local max_num_nyancats = math.floor(volume / (16 * 16 * 16))
|
||||
|
||||
if pr:next(0, chance) == 0 then
|
||||
local x0 = pr:next(minp.x, maxp.x)
|
||||
local y0 = pr:next(minp.y, maxp.y)
|
||||
local z0 = pr:next(minp.z, maxp.z)
|
||||
local p0 = { x = x0, y = y0, z = z0 }
|
||||
|
||||
place(p0, pr:next(0, 3), pr:next(3, 15))
|
||||
for i = 1, max_num_nyancats do
|
||||
if pr:next(0, 1000) == 0 then
|
||||
local x0 = pr:next(minp.x, maxp.x)
|
||||
local y0 = pr:next(minp.y, maxp.y)
|
||||
local z0 = pr:next(minp.z, maxp.z)
|
||||
local p0 = {x = x0, y = y0, z = z0}
|
||||
nyancat.place(p0, pr:next(0, 3), pr:next(3, 15))
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
core.register_on_generated(generate)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue