3 Commits

Author SHA1 Message Date
757221e668 mapGenerator: add generation grass and rock to meadow 2026-04-23 22:31:14 +03:00
3793afebbd Plant: add waving 2026-04-23 22:30:17 +03:00
af3ce8c769 plants: add meadow grass 2026-04-23 22:29:57 +03:00
4 changed files with 36 additions and 4 deletions

View File

@@ -9,6 +9,7 @@ local Plant = Node:getExtended({
paramtype = "light", paramtype = "light",
paramtype2 = "meshoptions", paramtype2 = "meshoptions",
walkable = false, walkable = false,
waving = 1,
buildable_to = true, buildable_to = true,
groups = {dig_immediate = 3}, groups = {dig_immediate = 3},
selection_box = { selection_box = {

View File

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

View File

@@ -38,3 +38,21 @@ Plant:new({
} }
}) })
Plant:new({
settings = {
name = 'meadow_grass_1',
tiles = {PlantsTileSheet:t(4,0)},
place_param2 = 3,
}
})
Plant:new({
settings = {
name = 'meadow_grass_2',
tiles = {PlantsTileSheet:t(5,0)},
place_param2 = 3,
}
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB