Mapgen: write SuperUltraSigmaMapgen part 7.1
This commit is contained in:
@@ -678,12 +678,17 @@ end
|
|||||||
---Run world generation through this mapgen object
|
---Run world generation through this mapgen object
|
||||||
---
|
---
|
||||||
---Note: only one instance of a `MapGen` class can be running.
|
---Note: only one instance of a `MapGen` class can be running.
|
||||||
|
---
|
||||||
|
---**FOR MAPGEN ENVIRONMENT ONLY**
|
||||||
function MapGen:run()
|
function MapGen:run()
|
||||||
if MapGen.isRunning then
|
if MapGen.isRunning then
|
||||||
error('Only one instance of a `MapGen` class can be running.')
|
error('Only one instance of a `MapGen` class can be running.')
|
||||||
end
|
end
|
||||||
|
|
||||||
core.register_on_generated(function(...)
|
core.register_on_generated(function(...)
|
||||||
|
-- TODO: удалить отключение проверки после исправления issue:
|
||||||
|
-- https://github.com/Voxrame/luanti-ide-helper/issues/6
|
||||||
|
---@diagnostic disable-next-line: param-type-not-match
|
||||||
self:onMapGenerated(...)
|
self:onMapGenerated(...)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@@ -66,9 +66,9 @@ function Peak:new(peakPos, multinoiseParams, groups)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function instance:initMultinoise()
|
function instance:initMultinoise()
|
||||||
--if not table.is_empty(_multinoise) then
|
if not table.is_empty(_multinoise) then
|
||||||
-- minetest.log('warning', 'Multinoise has already been initialized. Re-initialization is not recommended.')
|
minetest.log('warning', 'Multinoise has already been initialized. Re-initialization is not recommended.')
|
||||||
--end
|
end
|
||||||
|
|
||||||
_multinoise = multinoiseParamsToMultinoise(_multinoiseParams)
|
_multinoise = multinoiseParamsToMultinoise(_multinoiseParams)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,13 +1,33 @@
|
|||||||
-- MAPGEN ENVIROMENT ONLY
|
-- MAPGEN ENVIROMENT ONLY
|
||||||
|
-- https://api.luanti.org/core-namespace-reference/#mapgen-environment
|
||||||
|
|
||||||
|
-- This environment is isolated from the main environment,
|
||||||
|
-- so global tables need to be preloaded manually.
|
||||||
|
|
||||||
|
-- --- Global APIs load --
|
||||||
|
-- Ensure
|
||||||
|
dofile(core.get_modpath('smc__api__ensure')..'/init.lua')
|
||||||
|
|
||||||
|
-- Math
|
||||||
|
dofile(core.get_modpath('smc__api__math')..'/init.lua')
|
||||||
|
|
||||||
|
-- Require
|
||||||
|
dofile(core.get_modpath('smc__api__require')..'/init.lua')
|
||||||
|
|
||||||
|
-- Mod
|
||||||
|
dofile(core.get_modpath('smc__api__mod')..'/init.lua')
|
||||||
|
|
||||||
|
-- String
|
||||||
|
dofile(core.get_modpath('smc__api__string')..'/init.lua')
|
||||||
|
|
||||||
|
-- Table
|
||||||
|
dofile(core.get_modpath('smc__api__table')..'/init.lua')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- --- MapGen definiton ---
|
||||||
local id = core.get_content_id
|
local id = core.get_content_id
|
||||||
|
|
||||||
Require = dofile(core.get_modpath('smc__api__require')..'/init.lua')
|
|
||||||
|
|
||||||
---@type Mod
|
|
||||||
Mod = dofile(core.get_modpath('smc__api__mod')..'/init.lua')
|
|
||||||
print(core.get_modpath('smc__api__mod')..'/init.lua')
|
|
||||||
|
|
||||||
local mapGenRequire = Mod.getInfo('smc__core__map_gen').require
|
local mapGenRequire = Mod.getInfo('smc__core__map_gen').require
|
||||||
|
|
||||||
---@type MapGen
|
---@type MapGen
|
||||||
|
|||||||
@@ -1 +1,4 @@
|
|||||||
|
-- World generation runs in the mapgen environment (separate thread)
|
||||||
|
-- The Mapgen environment is isolated from the main enviroment.
|
||||||
|
|
||||||
core.register_mapgen_script(core.get_modpath(core.get_current_modname())..'/MapGenerator.lua')
|
core.register_mapgen_script(core.get_modpath(core.get_current_modname())..'/MapGenerator.lua')
|
||||||
Reference in New Issue
Block a user