mapGenerator: add generation grass and rock to meadow

This commit is contained in:
Van
2026-04-23 22:31:14 +03:00
parent 3793afebbd
commit 757221e668

View File

@@ -16,9 +16,9 @@ local MapGen = mapGenRequire('MapGen')
-- Rocks
sylite = 'rocks:sylite',
syliteGray = 'rocks:sylite_gray',
syliteGray = 'rocks:sylite_gray',
syliteBlack = 'rocks:sylite_black',
--tauitite = 'rocks:tauitite',
tauititeLight = 'rocks:tauitite_light',
--iyellite = 'rocks:iyellite',
--falmyte = 'rocks:falmyte',
--hapcoryte = 'rocks:hapcoryte',
@@ -717,6 +717,7 @@ local ryeNoiseParams = {
}
local ryeNoise
---@param mapGenerator MapGen
---@param nodeType MapGen.nodeType
---@param area VoxelArea
local function meadowPostProcessing(biome, mapGenerator, factors, data, data2, index, x, y, z, nodeType, area)
@@ -726,10 +727,22 @@ local function meadowPostProcessing(biome, mapGenerator, factors, data, data2, i
if ryeNoise == nil then ryeNoise = core.get_value_noise(ryeNoiseParams) end
if ryeNoise:get_2d({x=x, y=z}) + math.random(0, 3) > 8 then
local i = area:index(x,y+1,z)
local value = ryeNoise:get_2d({x=x, y=z}) + math.random(0, 5)
local i = area:index(x,y+1,z)
if value > 8 then
data[i] = id('plants:rye')
data2[i] = 3
elseif value > 5 then
data[i] = id('plants:meadow_grass_1')
data2[i] = 3
elseif value > 3 then
data[i] = id('plants:meadow_grass_2')
data2[i] = 3
end
if ryeNoise:get_2d({x=x, y=z}) - math.random(0, 3) < -8 then
data[index] = mapGenerator.nodeIDs.tauititeLight
end
end