MapGen: add bime weight and minor fixes. Close #7

This commit is contained in:
Van
2026-06-26 22:08:41 +03:00
parent d04f3407b4
commit 80c0f45f34
4 changed files with 62 additions and 32 deletions

View File

@@ -21,7 +21,7 @@ end
local require = Mod.getInfo('smc__core__map_gen').require
---Numeric values ​​defining the surface height and climate for the node.
---@alias MapGen.Factors {height:number, temp:number, humidity:number}
---@alias MapGen.Factors {height:number, temp:number, humidity:number, weight:number}
---Table of all past generation factor calculations for nodes.
---
@@ -690,8 +690,10 @@ local function generateNode(mapGenerator, layer, factors, data, data2, index, x,
scattHeight, scattTemp, scattHumidity = mathRound(scattHeight), mathRound(scattTemp), mathRound(scattHumidity)
height, temp, humidity = mathRound(height), mathRound(scattTemp), mathRound(scattHumidity)
local diagramPoint = layer.biomesDiagram[height][scattTemp][scattHumidity] -- TODO: разобраться со смещением по вертикали
---@type MapGen.Biome
local biome = layer.biomesDiagram[scattHeight][scattTemp][scattHumidity]
local biome = diagramPoint.biome
factors.weight = diagramPoint.weight
-- If the block is above surface height and above water level...
if y > height and y > waterLevel then
@@ -1036,6 +1038,9 @@ function MapGen:onMapGenerated(voxelManip, minPos, maxPos, blockseed)
end
end
-- Clear post processing tables
dataPostProcessing, vmPostProcessing = {}, {}
core.generate_ores(voxelManip, minPos, maxPos)
core.generate_decorations(voxelManip, minPos, maxPos)