Tiefen und Höhen der Mods/Biome angepasst

This commit is contained in:
N-Nachtigal 2025-05-22 01:05:01 +02:00
parent ee3c9fbad6
commit f7d9844d54
4 changed files with 18 additions and 14 deletions

View file

@ -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)