Rename API -> SYSTEM

This commit is contained in:
Van
2026-01-14 15:14:38 +03:00
parent 50dd702e6e
commit 0c5f508152
54 changed files with 57 additions and 54 deletions

View File

@@ -24,6 +24,7 @@
"enables": [],
"globals": [
"core",
"Smc",
"table",
"Events",
"VoxelArea",

8
.gitmodules vendored
View File

@@ -1,7 +1,7 @@
[submodule "mods/API/Utf8"]
path = mods/API/Utf8
url = https://https://git.apancore.ru/Apancore.Studio/utf8_api
branch = main
#[submodule "mods/SYSTEM/Utf8"]
# path = mods/SYSTEM/Utf8
# url = https://https://git.apancore.ru/Apancore.Studio/utf8_api
# branch = main
[submodule "util/ide-helper"]
path = util/ide-helper
url = https://github.com/Voxrame/luanti-ide-helper.git

View File

@@ -1,4 +0,0 @@
local modInfo = Mod.getInfo('smc__api__api')
local require = modInfo.require
require('Api')

View File

@@ -1,3 +0,0 @@
name = smc__api__api
description = Include this mod in your `depends` to ensure all necessary APIs are loaded for your mod
depends = smc__api__ensure, smc__api__math, smc__api__mod, smc__api__require, smc__api__table, smc__api__string, smc__api__utf8, smc__api__class

View File

@@ -1,6 +0,0 @@
Api = {}
local modInfo = Mod.getInfo('smc__api__api')
local require = modInfo.require
require('Api.globalStep')

View File

@@ -1 +0,0 @@
name = smc__api__class

View File

@@ -1 +0,0 @@
name = smc__api__ensure

View File

@@ -1,2 +0,0 @@
name = smc__api__events
depends = smc__api__table

View File

@@ -1 +0,0 @@
name = smc__api__logger

View File

@@ -1 +0,0 @@
name = smc__api__math

View File

@@ -1 +0,0 @@
name = smc__api__mod

View File

@@ -1 +0,0 @@
name = smc__api__require

View File

@@ -1,2 +0,0 @@
name = smc__api__string
depends = smc__api__ensure

View File

@@ -1,2 +0,0 @@
name = smc__api__table
depends = smc__api__ensure

0
mods/API/Utf8/init.lua Normal file
View File

View File

@@ -1 +0,0 @@
name = smc__api

View File

@@ -1,2 +1,2 @@
name = smc__core__control
depends = smc__api__api
depends = smc__system__system_loader

View File

@@ -80,7 +80,7 @@ core.register_on_leaveplayer(function(player, timed_out)
playersControlTimer[playerName] = nil
end)
Api.registerGlobalStepForEachPlayer(0, function(deltaTime, player)
Smc.registerGlobalStepForEachPlayer(0, function(deltaTime, player)
if player == nil then
return
end

View File

@@ -1,2 +1,2 @@
name = smc__core__craft_system
depends = smc__api__api
depends = smc__system__system_loader

View File

@@ -1,2 +1,2 @@
name = smc__core__formspec
depends = smc__api__api
depends = smc__system__system_loader

View File

@@ -1,2 +1,2 @@
name = smc__core__item
depends = smc__api__api, smc__core__item_factory
depends = smc__system__system_loader, smc__core__item_factory

View File

@@ -1,2 +1,2 @@
name = smc__core__item_factory
depends = smc__api__api
depends = smc__system__system_loader

View File

@@ -1,2 +1,2 @@
name = smc__core__map_gen
depends = smc__api__api
depends = smc__system__system_loader

View File

@@ -1,2 +1,2 @@
name = smc__core__player
depends = smc__api__api
depends = smc__system__system_loader

View File

@@ -1,2 +1,2 @@
name = smc__core__sound
depends = smc__api__api
depends = smc__system__system_loader

View File

@@ -1,2 +1,2 @@
name = smc__core__tilesheet
depends = smc__api__api
depends = smc__system__system_loader

View File

@@ -1,2 +1,2 @@
name = smc__core__admin_commands
depends = smc__api__api, smc__core__formspec, smc__core__item
depends = smc__system__system_loader, smc__core__formspec, smc__core__item

View File

@@ -6,37 +6,37 @@
-- --- Global APIs load --
-- Class
dofile(core.get_modpath('smc__api__class')..'/init.lua')
dofile(core.get_modpath('smc__system__class')..'/init.lua')
-- Ensure
dofile(core.get_modpath('smc__api__ensure')..'/init.lua')
dofile(core.get_modpath('smc__system__ensure')..'/init.lua')
-- Logger
dofile(core.get_modpath('smc__api__logger')..'/init.lua')
dofile(core.get_modpath('smc__system__logger')..'/init.lua')
-- Math
dofile(core.get_modpath('smc__api__math')..'/init.lua')
dofile(core.get_modpath('smc__system__math')..'/init.lua')
-- Require
dofile(core.get_modpath('smc__api__require')..'/init.lua')
dofile(core.get_modpath('smc__system__require')..'/init.lua')
-- Mod
dofile(core.get_modpath('smc__api__mod')..'/init.lua')
dofile(core.get_modpath('smc__system__mod')..'/init.lua')
-- TODO: исправить загрузку строковых библиотек (хотя они пока что не юзаются в мапгене)
-- Они не работают из-за get_current_modname внутри utf8
-- UTF-8
-- dofile(core.get_modpath('smc__api__utf8')..'/init.lua')
-- dofile(core.get_modpath('smc__system__utf8')..'/init.lua')
-- String
-- dofile(core.get_modpath('smc__api__string')..'/init.lua')
-- dofile(core.get_modpath('smc__system__string')..'/init.lua')
-- Table
dofile(core.get_modpath('smc__api__table')..'/init.lua')
dofile(core.get_modpath('smc__system__table')..'/init.lua')
-- TODO: пока что закоментировано, поскольку вызывает ошибку из-за global_step
-- Api loader
-- dofile(core.get_modpath('smc__api__api')..'/init.lua')
-- Smc lib loader
-- dofile(core.get_modpath('smc__system__helper_lib')..'/init.lua')
---@type MapGen
local mapGenerator = dofile(core.get_modpath('smc__core__map_generator')..'/src/mapGenerator.lua')

View File

@@ -0,0 +1 @@
name = smc__system__class

View File

@@ -0,0 +1 @@
name = smc__system__ensure

View File

@@ -0,0 +1,2 @@
name = smc__system__events
depends = smc__system__table

View File

@@ -0,0 +1,4 @@
local modInfo = Mod.getInfo('smc__system__helper_lib')
local require = modInfo.require
require('Lib')

View File

@@ -0,0 +1,2 @@
name = smc__system__helper_lib
depends = smc__system__ensure

View File

@@ -0,0 +1,6 @@
Smc = {}
local modInfo = Mod.getInfo('smc__system__helper_lib')
local require = modInfo.require
require('Lib.globalStep')

View File

@@ -3,7 +3,7 @@ local callsWithDelay = {}
---@param timeDelay number
---@param callbackFunc fun(deltaTime:number)
function Api.registerGlobalStepWithDelay(timeDelay, callbackFunc)
function Smc.registerGlobalStepWithDelay(timeDelay, callbackFunc)
table.insert(callsWithDelay, {
timeDelay = timeDelay,
callbackFunc = callbackFunc,
@@ -40,7 +40,7 @@ local callsForEachPlayer = {}
---@param timeDelay number
---@param callbackFunc fun(deltaTime:number, player:Player)
function Api.registerGlobalStepForEachPlayer(timeDelay, callbackFunc)
function Smc.registerGlobalStepForEachPlayer(timeDelay, callbackFunc)
table.insert(callsWithDelay, {
timeDelay = timeDelay,
callbackFunc = callbackFunc,

View File

@@ -0,0 +1 @@
name = smc__system__logger

View File

@@ -0,0 +1 @@
name = smc__system__math

1
mods/SYSTEM/Mod/mod.conf Normal file
View File

@@ -0,0 +1 @@
name = smc__system__mod

View File

@@ -0,0 +1 @@
name = smc__system__require

View File

@@ -0,0 +1,2 @@
name = smc__system__string
depends = smc__system__ensure

View File

View File

@@ -0,0 +1,3 @@
name = smc__system__system_loader
description = Include this mod in your `depends` to ensure all necessary Libs are loaded for your mod
depends = smc__system__ensure, smc__system__math, smc__system__mod, smc__system__require, smc__system__table, smc__system__string, smc__system__utf8, smc__system__class, smc__system__helper_lib

View File

@@ -0,0 +1,2 @@
name = smc__system__table
depends = smc__system__ensure

1
mods/SYSTEM/modpack.conf Normal file
View File

@@ -0,0 +1 @@
name = smc__system