Mapgen: write SuperUltraSigmaMapgen part 7 (async)

This commit is contained in:
Van
2025-11-23 19:06:37 +03:00
parent 54cc31e14e
commit 1e430aaeb0
11 changed files with 169 additions and 162 deletions

View File

@@ -37,7 +37,7 @@ local pastNoise2DCalc = {
}
}
local modInfo = Mod.getInfo()
local modInfo = Mod.getInfo('smc__core__map_gen')
local require = modInfo.require
---@type MapGen.Layer
@@ -70,7 +70,7 @@ local MapGen = {
isRunning = false,
}
---@param nodeIDs table<string, string>
---@param nodeIDs table<string, number>
---@return MapGen
function MapGen:new(nodeIDs)
---@type MapGen
@@ -623,12 +623,15 @@ local function generatorHandler(mapGenerator, data, index, x, y, z)
generateNode(mapGenerator, layer, noiseHeightValue, noiseTempValue, noiseHumidityValue, data, index, x, y, z)
end
---@param voxelManip VoxelManip
---@param minPos table
---@param maxPos table
---@param blockseed number
function MapGen:onMapGenerated(minPos, maxPos, blockseed)
function MapGen:onMapGenerated(voxelManip, minPos, maxPos, blockseed)
-- We obtain a generation area for further manipulations
local voxelManip, eMin, eMax = core.get_mapgen_object('voxelmanip')
--local voxelManip, eMin, eMax = core.get_mapgen_object('voxelmanip')
local eMin, eMax = voxelManip:get_emerged_area()
if not self.peaksMultinoiseInitialized then
self:initPeaksMultinoise()
@@ -665,7 +668,7 @@ function MapGen:onMapGenerated(minPos, maxPos, blockseed)
voxelManip:calc_lighting()
voxelManip:update_liquids()
voxelManip:write_to_map()
--voxelManip:write_to_map() -- Async edit
end

View File

@@ -63,9 +63,9 @@ function Cavern:new(name, def)
end
function instance:initNoise()
if not table.is_empty(_noise) then
minetest.log('warning', 'Cavern noise has already been initialized. Re-initialization is not recommended.')
end
--if not table.is_empty(_noise) then
-- minetest.log('warning', 'Cavern noise has already been initialized. Re-initialization is not recommended.')
--end
_noise = core.get_value_noise(_noiseParams)
end

View File

@@ -66,9 +66,9 @@ function Peak:new(peakPos, multinoiseParams, groups)
end
function instance:initMultinoise()
if not table.is_empty(_multinoise) then
minetest.log('warning', 'Multinoise has already been initialized. Re-initialization is not recommended.')
end
--if not table.is_empty(_multinoise) then
-- minetest.log('warning', 'Multinoise has already been initialized. Re-initialization is not recommended.')
--end
_multinoise = multinoiseParamsToMultinoise(_multinoiseParams)
end

View File

@@ -1,6 +1,6 @@
local mathAbs = math.abs
local modInfo = Mod.getInfo()
local modInfo = Mod.getInfo('smc__core__map_gen')
local require = modInfo.require
---@type MapGen.Triangle

View File

@@ -1,7 +1,7 @@
local mathSqrt, mathAbs
= math.sqrt, math.abs
local modInfo = Mod.getInfo()
local modInfo = Mod.getInfo('smc__core__map_gen')
local require = modInfo.require
---@type MapGen.Triangulation.Edge

View File

@@ -12,7 +12,7 @@
local assert, mathMax, tableRemove
= assert, math.max, table.remove
local modInfo = Mod.getInfo()
local modInfo = Mod.getInfo('smc__core__map_gen')
local require = modInfo.require
---@type MapGen.Triangle

View File

@@ -1,4 +1,4 @@
local modInfo = Mod.getInfo()
local modInfo = Mod.getInfo('smc__core__map_gen')
local require = modInfo.require
---@type MapGen.Peak