From b25219b947f49c8cb5f0c21b414e251c492ede24 Mon Sep 17 00:00:00 2001 From: Vanic Date: Sat, 30 Aug 2025 15:26:49 +0000 Subject: [PATCH] idk fix --- mods/API/Mod/init.lua | 9 ++------- mods/CORE/Item/src/Item.lua | 9 ++++----- mods/CORE/MapGen/src/MapGen.lua | 11 +---------- mods/CORE/MapGen/src/MapGen/Layer.lua | 8 +------- mods/CORE/Node/src/Node.lua | 7 +++++++ 5 files changed, 15 insertions(+), 29 deletions(-) diff --git a/mods/API/Mod/init.lua b/mods/API/Mod/init.lua index 6e04c0f..76fbc20 100644 --- a/mods/API/Mod/init.lua +++ b/mods/API/Mod/init.lua @@ -4,16 +4,11 @@ ---@field public path string Path to the mod folder. ---@field public Class table A public class that provides a mod. ---@field public require fun(FileName:string) -Mod = { - name = nil, - path = nil, - require = nil, - Class = nil, -} +Mod = {} --- Return table with mod name, path and require function. ----@return {name: string, path: string, require: fun(FileName : string)} +---@return {name: string, path: string, require: fun(FileName : string): table} function Mod.getInfo() local name = core.get_current_modname() local path = core.get_modpath(name) diff --git a/mods/CORE/Item/src/Item.lua b/mods/CORE/Item/src/Item.lua index 2c9868e..c0efbc3 100644 --- a/mods/CORE/Item/src/Item.lua +++ b/mods/CORE/Item/src/Item.lua @@ -1,10 +1,7 @@ ---@class Item ---@field itemDef Item.ItemDefinition ---@field luantiDef table -local Item = { - itemDef = nil, - luantiDef = nil, -} +local Item = {} ---@param itemDef Item.ItemDefinition local function itemDefToLuantiDef(itemDef) @@ -38,7 +35,9 @@ end ---@param itemDef Item.ItemDefinition ---@return Item function Item:new(itemDef) - local instance = {} + ---@type Item + local instance = setmetatable({}, {__index = self}) + local luantiDef = itemDefToLuantiDef(itemDef) local visual = itemDef.settings.visual itemDef.settings.visual = nil diff --git a/mods/CORE/MapGen/src/MapGen.lua b/mods/CORE/MapGen/src/MapGen.lua index 68b7ffe..b895573 100644 --- a/mods/CORE/MapGen/src/MapGen.lua +++ b/mods/CORE/MapGen/src/MapGen.lua @@ -21,16 +21,7 @@ local Region3D = require("MapGen.Region.Region3D") ---@field layersList table ---@field registeredRegions table ---@field material table -local MapGen = { - layersByName = nil, - layersList = nil, - registeredRegions = nil, - materials = { - impassableWater = nil, - impassableSeabed = nil, - air = nil, - }, -} +local MapGen = {} ---@return MapGen function MapGen:new() diff --git a/mods/CORE/MapGen/src/MapGen/Layer.lua b/mods/CORE/MapGen/src/MapGen/Layer.lua index 1684d81..61c6467 100644 --- a/mods/CORE/MapGen/src/MapGen/Layer.lua +++ b/mods/CORE/MapGen/src/MapGen/Layer.lua @@ -6,13 +6,7 @@ local table, setmetatable = table, setmetatable ---@field maxY number ---@field regions2D MapGen.Region.Region2D[] ---@field regions3D MapGen.Region.Region3D[] -local Layer = { - name = nil, - minY = nil, - maxY = nil, - regions2D = nil, - regions3D = nil, -} +local Layer = {} ---@return MapGen.Layer ---@param name string diff --git a/mods/CORE/Node/src/Node.lua b/mods/CORE/Node/src/Node.lua index 332191d..f8d05f7 100644 --- a/mods/CORE/Node/src/Node.lua +++ b/mods/CORE/Node/src/Node.lua @@ -3,8 +3,15 @@ local Node = Core.Item:getModClassExtended({ --TODO: Че тут писать? }) + +---@return Node function Node:new() + ---@type Node + local instance + --TODO: Это надо вообще? + + return instance end return Node \ No newline at end of file