From e5401078763f20f7021802786efdd109ebd72582 Mon Sep 17 00:00:00 2001 From: varttist Date: Fri, 13 Nov 2026 17:43:26 +0300 Subject: [PATCH] `Mod`: `.getInfo()` -> `:getInfo()` --- mods/CORE/BaseProcessingStation/init.lua | 2 +- mods/CORE/BaseUI/init.lua | 2 +- mods/CORE/Controls/init.lua | 2 +- mods/CORE/CraftSystem/init.lua | 2 +- mods/CORE/CraftSystem/src/CraftSystem.lua | 2 +- .../src/CraftSystem/BaseCraftHandler.lua | 2 +- .../src/CraftSystem/ImmersiveCraft.lua | 2 +- .../src/CraftSystem/ImmersiveCraftHandler.lua | 2 +- .../src/CraftSystem/ImmersiveCraftNode.lua | 2 +- .../ImmersiveCraftNode/tappingNode.lua | 2 +- .../ImmersiveCraftStage/TappingStage.lua | 2 +- .../src/CraftSystem/PrimitiveCraft.lua | 2 +- .../src/CraftSystem/PrimitiveCraftHandler.lua | 2 +- .../src/CraftSystem/ProcessingCraft.lua | 2 +- .../CraftSystem/ProcessingCraftHandler.lua | 2 +- mods/CORE/Creature/init.lua | 2 +- mods/CORE/Creature/src/Creature.lua | 2 +- mods/CORE/Formspec/init.lua | 2 +- mods/CORE/ImmersiveWorkStation/init.lua | 2 +- .../src/ImmersiveWorkStation.lua | 2 +- mods/CORE/Item/init.lua | 2 +- mods/CORE/Item/src/Item.lua | 4 +-- mods/CORE/ItemFactory/init.lua | 2 +- mods/CORE/MapGen/init.lua | 2 +- mods/CORE/MapGen/src/MapGen.lua | 2 +- mods/CORE/MapGen/src/MapGen/FakePeak.lua | 2 +- mods/CORE/MapGen/src/MapGen/Layer.lua | 2 +- mods/CORE/MapGen/src/MapGen/Tree.lua | 2 +- mods/CORE/MapGen/src/MapGen/Triangle.lua | 2 +- mods/CORE/Node/init.lua | 2 +- mods/CORE/Plant/init.lua | 2 +- mods/CORE/Player/init.lua | 2 +- mods/CORE/Player/src/Player.lua | 4 +-- mods/CORE/Player/src/Player/inventory.lua | 2 +- mods/CORE/ProcessingContainerStation/init.lua | 2 +- mods/CORE/ProcessingFuelStation/init.lua | 2 +- mods/CORE/ProcessingStation/init.lua | 2 +- mods/CORE/ProgressionSystem/init.lua | 2 +- .../src/ProgressionSystem.lua | 2 +- mods/CORE/Sound/init.lua | 2 +- mods/CORE/TileSheet/init.lua | 2 +- mods/CORE/Tool/init.lua | 2 +- mods/ENVIRONMENT/mapGenerator/init.lua | 2 +- .../mapGenerator/src/mapGenerator.lua | 2 +- mods/GAME/ITEMS/rocks/init.lua | 2 +- mods/GAME/adminCommands/init.lua | 4 +-- mods/SYSTEM/Events/init.lua | 2 +- mods/SYSTEM/HelperLib/init.lua | 2 +- mods/SYSTEM/HelperLib/src/Lib.lua | 2 +- mods/SYSTEM/HelperLib/src/Lib/requires.lua | 30 +++++++++---------- mods/SYSTEM/Mod/init.lua | 4 +-- mods/UI/PlayerInventoryUI/init.lua | 2 +- .../src/PlayerInventoryUI.lua | 2 +- .../src/PlayerInventoryUI/getCraftTab.lua | 2 +- mods/UI/WorkStationUI/init.lua | 2 +- 55 files changed, 73 insertions(+), 73 deletions(-) diff --git a/mods/CORE/BaseProcessingStation/init.lua b/mods/CORE/BaseProcessingStation/init.lua index b8d2647..f84a8fc 100644 --- a/mods/CORE/BaseProcessingStation/init.lua +++ b/mods/CORE/BaseProcessingStation/init.lua @@ -1,4 +1,4 @@ -local modInfo = Mod.getInfo('smc__core__base_processing_station') +local modInfo = Mod:getInfo('smc__core__base_processing_station') local require = modInfo.require return require('BaseProcessingStation') diff --git a/mods/CORE/BaseUI/init.lua b/mods/CORE/BaseUI/init.lua index 9b276ca..0d2def5 100644 --- a/mods/CORE/BaseUI/init.lua +++ b/mods/CORE/BaseUI/init.lua @@ -1,4 +1,4 @@ -local modInfo = Mod.getInfo('smc__core__base_ui') +local modInfo = Mod:getInfo('smc__core__base_ui') local require = modInfo.require return require('BaseUI') diff --git a/mods/CORE/Controls/init.lua b/mods/CORE/Controls/init.lua index eaed8ac..6f30a48 100644 --- a/mods/CORE/Controls/init.lua +++ b/mods/CORE/Controls/init.lua @@ -1,4 +1,4 @@ -local modInfo = Mod.getInfo('smc__core__controls') +local modInfo = Mod:getInfo('smc__core__controls') local require = modInfo.require return require('Controls') diff --git a/mods/CORE/CraftSystem/init.lua b/mods/CORE/CraftSystem/init.lua index ad7e94e..157481c 100644 --- a/mods/CORE/CraftSystem/init.lua +++ b/mods/CORE/CraftSystem/init.lua @@ -1,4 +1,4 @@ -local modInfo = Mod.getInfo('smc__core__craft_system') +local modInfo = Mod:getInfo('smc__core__craft_system') local require = modInfo.require return require('CraftSystem') diff --git a/mods/CORE/CraftSystem/src/CraftSystem.lua b/mods/CORE/CraftSystem/src/CraftSystem.lua index 8b56503..90fa6e1 100644 --- a/mods/CORE/CraftSystem/src/CraftSystem.lua +++ b/mods/CORE/CraftSystem/src/CraftSystem.lua @@ -1,6 +1,6 @@ local tableJoin = table.join -local modInfo = Mod.getInfo('smc__core__craft_system') +local modInfo = Mod:getInfo('smc__core__craft_system') local require = modInfo.require ---@type CraftSystem.PrimitiveCraftHandler diff --git a/mods/CORE/CraftSystem/src/CraftSystem/BaseCraftHandler.lua b/mods/CORE/CraftSystem/src/CraftSystem/BaseCraftHandler.lua index c6839c3..72e0eab 100644 --- a/mods/CORE/CraftSystem/src/CraftSystem/BaseCraftHandler.lua +++ b/mods/CORE/CraftSystem/src/CraftSystem/BaseCraftHandler.lua @@ -3,7 +3,7 @@ local assert, pairs, ipairs = assert, pairs, ipairs local tableInsert, tableSort, tableJoin = table.insert, table.sort, table.join local stringMatch, stringLower = string.match, string_utf8.lower -local require = Mod.getInfo('smc__core__craft_system').require +local require = Mod:getInfo('smc__core__craft_system').require ---@type CraftSystem.BaseCraftHandler.PlayerCraftsCache local PlayerCraftsCache = require('CraftSystem.BaseCraftHandler.PlayerCraftsCache') diff --git a/mods/CORE/CraftSystem/src/CraftSystem/ImmersiveCraft.lua b/mods/CORE/CraftSystem/src/CraftSystem/ImmersiveCraft.lua index ca2fd33..ec43141 100644 --- a/mods/CORE/CraftSystem/src/CraftSystem/ImmersiveCraft.lua +++ b/mods/CORE/CraftSystem/src/CraftSystem/ImmersiveCraft.lua @@ -2,7 +2,7 @@ local v = vector.new local assert, ipairs, tostring = assert, ipairs, tostring local coreChatSendPlayer, coreItemDrop = core.chat_send_player, core.item_drop -local require = Mod.getInfo('smc__core__craft_system').require +local require = Mod:getInfo('smc__core__craft_system').require local ImmersiveCraftEvents = Smc.requireEvents('ImmersiveCraftEvents') --[[@as Events.ImmersiveCraftEvents]] diff --git a/mods/CORE/CraftSystem/src/CraftSystem/ImmersiveCraftHandler.lua b/mods/CORE/CraftSystem/src/CraftSystem/ImmersiveCraftHandler.lua index 52d7dd5..ae3f000 100644 --- a/mods/CORE/CraftSystem/src/CraftSystem/ImmersiveCraftHandler.lua +++ b/mods/CORE/CraftSystem/src/CraftSystem/ImmersiveCraftHandler.lua @@ -2,7 +2,7 @@ local assert = assert local tableInsert, tableMerge = table.insert, table.merge -local modInfo = Mod.getInfo('smc__core__craft_system') +local modInfo = Mod:getInfo('smc__core__craft_system') local require = modInfo.require ---@type CraftSystem.BaseCraftHandler diff --git a/mods/CORE/CraftSystem/src/CraftSystem/ImmersiveCraftNode.lua b/mods/CORE/CraftSystem/src/CraftSystem/ImmersiveCraftNode.lua index 3b556df..f8391c8 100644 --- a/mods/CORE/CraftSystem/src/CraftSystem/ImmersiveCraftNode.lua +++ b/mods/CORE/CraftSystem/src/CraftSystem/ImmersiveCraftNode.lua @@ -1,5 +1,5 @@ ---@type Creature -local Creature = Mod.getInfo('smc__core__creature').require('Creature') +local Creature = Mod:getInfo('smc__core__creature').require('Creature') ---The entity the player interacts with during immersive crafting. ---@class CraftSystem.ImmersiveCraftNode : Creature diff --git a/mods/CORE/CraftSystem/src/CraftSystem/ImmersiveCraftNode/tappingNode.lua b/mods/CORE/CraftSystem/src/CraftSystem/ImmersiveCraftNode/tappingNode.lua index f2393ad..5d3e68f 100644 --- a/mods/CORE/CraftSystem/src/CraftSystem/ImmersiveCraftNode/tappingNode.lua +++ b/mods/CORE/CraftSystem/src/CraftSystem/ImmersiveCraftNode/tappingNode.lua @@ -1,4 +1,4 @@ -local require = Mod.getInfo('smc__core__craft_system').require +local require = Mod:getInfo('smc__core__craft_system').require local ImmersiveCraftEvents = Smc.requireEvents('ImmersiveCraftEvents') --[[@as Events.ImmersiveCraftEvents]] diff --git a/mods/CORE/CraftSystem/src/CraftSystem/ImmersiveCraftStage/TappingStage.lua b/mods/CORE/CraftSystem/src/CraftSystem/ImmersiveCraftStage/TappingStage.lua index f513f4e..a550759 100644 --- a/mods/CORE/CraftSystem/src/CraftSystem/ImmersiveCraftStage/TappingStage.lua +++ b/mods/CORE/CraftSystem/src/CraftSystem/ImmersiveCraftStage/TappingStage.lua @@ -3,7 +3,7 @@ local assert = assert local extend = Class.extend local coreItemDrop = core.item_drop -local require = Mod.getInfo('smc__core__craft_system').require +local require = Mod:getInfo('smc__core__craft_system').require local ImmersiveCraftEvents = Smc.requireEvents('ImmersiveCraftEvents') --[[@as Events.ImmersiveCraftEvents]] diff --git a/mods/CORE/CraftSystem/src/CraftSystem/PrimitiveCraft.lua b/mods/CORE/CraftSystem/src/CraftSystem/PrimitiveCraft.lua index f40558e..9ad6b45 100644 --- a/mods/CORE/CraftSystem/src/CraftSystem/PrimitiveCraft.lua +++ b/mods/CORE/CraftSystem/src/CraftSystem/PrimitiveCraft.lua @@ -1,6 +1,6 @@ local getInstance, extend = Class.getInstance, Class.extend -local modInfo = Mod.getInfo('smc__core__craft_system') +local modInfo = Mod:getInfo('smc__core__craft_system') local require = modInfo.require ---@type CraftSystem.BaseCraft diff --git a/mods/CORE/CraftSystem/src/CraftSystem/PrimitiveCraftHandler.lua b/mods/CORE/CraftSystem/src/CraftSystem/PrimitiveCraftHandler.lua index ae2a2b2..422b4b6 100644 --- a/mods/CORE/CraftSystem/src/CraftSystem/PrimitiveCraftHandler.lua +++ b/mods/CORE/CraftSystem/src/CraftSystem/PrimitiveCraftHandler.lua @@ -2,7 +2,7 @@ local extend = Class.extend local tableInsert, tableSort, tableJoin = table.insert, table.sort, table.join -local modInfo = Mod.getInfo('smc__core__craft_system') +local modInfo = Mod:getInfo('smc__core__craft_system') local require = modInfo.require ---@type CraftSystem.BaseCraftHandler diff --git a/mods/CORE/CraftSystem/src/CraftSystem/ProcessingCraft.lua b/mods/CORE/CraftSystem/src/CraftSystem/ProcessingCraft.lua index 3162fdd..f1c5391 100644 --- a/mods/CORE/CraftSystem/src/CraftSystem/ProcessingCraft.lua +++ b/mods/CORE/CraftSystem/src/CraftSystem/ProcessingCraft.lua @@ -1,6 +1,6 @@ local getInstance, extend = Class.getInstance, Class.extend -local modInfo = Mod.getInfo('smc__core__craft_system') +local modInfo = Mod:getInfo('smc__core__craft_system') local require = modInfo.require ---@type CraftSystem.BaseCraft diff --git a/mods/CORE/CraftSystem/src/CraftSystem/ProcessingCraftHandler.lua b/mods/CORE/CraftSystem/src/CraftSystem/ProcessingCraftHandler.lua index 15015fc..beecea2 100644 --- a/mods/CORE/CraftSystem/src/CraftSystem/ProcessingCraftHandler.lua +++ b/mods/CORE/CraftSystem/src/CraftSystem/ProcessingCraftHandler.lua @@ -2,7 +2,7 @@ local HASH_SEPARATOR = ',' local tableInsert, tableCopy, tableSort, tableConcat, tableIsEmpty = table.insert, table.copy, table.sort, table.concat, table.is_empty -local modInfo = Mod.getInfo('smc__core__craft_system') +local modInfo = Mod:getInfo('smc__core__craft_system') local require = modInfo.require ---@type CraftSystem.BaseCraftHandler diff --git a/mods/CORE/Creature/init.lua b/mods/CORE/Creature/init.lua index eb5c205..4d4bd12 100644 --- a/mods/CORE/Creature/init.lua +++ b/mods/CORE/Creature/init.lua @@ -1,4 +1,4 @@ -local modInfo = Mod.getInfo('smc__core__creature') +local modInfo = Mod:getInfo('smc__core__creature') local require = modInfo.require return require('Creature') diff --git a/mods/CORE/Creature/src/Creature.lua b/mods/CORE/Creature/src/Creature.lua index e0176fa..3219270 100644 --- a/mods/CORE/Creature/src/Creature.lua +++ b/mods/CORE/Creature/src/Creature.lua @@ -48,7 +48,7 @@ function Creature:new(entityDef) -- Add the short mod name prefix to the entity name. if s._add_mod_name then - s._name = Mod.getInfo().shortName .. ':' .. s._name + s._name = Mod:getInfo().shortName .. ':' .. s._name end local onActivate = c.on_activate or function() end diff --git a/mods/CORE/Formspec/init.lua b/mods/CORE/Formspec/init.lua index ee75934..2bc53be 100644 --- a/mods/CORE/Formspec/init.lua +++ b/mods/CORE/Formspec/init.lua @@ -1,4 +1,4 @@ -local modInfo = Mod.getInfo('smc__core__formspec') +local modInfo = Mod:getInfo('smc__core__formspec') local require = modInfo.require return require('Formspec') \ No newline at end of file diff --git a/mods/CORE/ImmersiveWorkStation/init.lua b/mods/CORE/ImmersiveWorkStation/init.lua index c70230d..baa9dbe 100644 --- a/mods/CORE/ImmersiveWorkStation/init.lua +++ b/mods/CORE/ImmersiveWorkStation/init.lua @@ -1,4 +1,4 @@ -local modInfo = Mod.getInfo('smc__core__immersive_work_station') +local modInfo = Mod:getInfo('smc__core__immersive_work_station') local require = modInfo.require return require('ImmersiveWorkStation') diff --git a/mods/CORE/ImmersiveWorkStation/src/ImmersiveWorkStation.lua b/mods/CORE/ImmersiveWorkStation/src/ImmersiveWorkStation.lua index 015c0c1..68ff96d 100644 --- a/mods/CORE/ImmersiveWorkStation/src/ImmersiveWorkStation.lua +++ b/mods/CORE/ImmersiveWorkStation/src/ImmersiveWorkStation.lua @@ -178,7 +178,7 @@ end local handler = CraftSystem:getImmersiveCraftHandler('workbench') -local require = Mod.getInfo('smc__ui__player_inventory').require +local require = Mod:getInfo('smc__ui__player_inventory').require local baseGetCraftTab = require('PlayerInventoryUI.baseGetCraftTab') ---@param self PlayerInventoryUI diff --git a/mods/CORE/Item/init.lua b/mods/CORE/Item/init.lua index 505e088..9494402 100644 --- a/mods/CORE/Item/init.lua +++ b/mods/CORE/Item/init.lua @@ -1,4 +1,4 @@ -local modInfo = Mod.getInfo('smc__core__item') +local modInfo = Mod:getInfo('smc__core__item') local require = modInfo.require return require('Item') diff --git a/mods/CORE/Item/src/Item.lua b/mods/CORE/Item/src/Item.lua index 33a66b4..4bfc28c 100644 --- a/mods/CORE/Item/src/Item.lua +++ b/mods/CORE/Item/src/Item.lua @@ -86,7 +86,7 @@ end ---@param itemDef Item.ItemDefinition ---@return ItemDefinition local function itemDefToLuantiDef(itemDef) - local modName = Mod.getInfo().shortName + local modName = Mod:getInfo().shortName local S = core.get_translator(modName) local s = itemDef.settings @@ -167,7 +167,7 @@ function Item:new(itemDef) itemDef = tableMerge(itemDef, self.defaultDef, true) --[[@as Item.ItemDefinition]] local s = itemDef.settings - local shortModName = Mod.getInfo().shortName + local shortModName = Mod:getInfo().shortName if s._add_mod_name then s.name = shortModName .. ':' .. s.name diff --git a/mods/CORE/ItemFactory/init.lua b/mods/CORE/ItemFactory/init.lua index 00a1cd2..ffd08b5 100644 --- a/mods/CORE/ItemFactory/init.lua +++ b/mods/CORE/ItemFactory/init.lua @@ -1,4 +1,4 @@ -local modInfo = Mod.getInfo('smc__core__item_factory') +local modInfo = Mod:getInfo('smc__core__item_factory') local require = modInfo.require return require('ItemFactory') \ No newline at end of file diff --git a/mods/CORE/MapGen/init.lua b/mods/CORE/MapGen/init.lua index a36fe0b..ab0d74b 100644 --- a/mods/CORE/MapGen/init.lua +++ b/mods/CORE/MapGen/init.lua @@ -1,4 +1,4 @@ -local modInfo = Mod.getInfo('smc__core__map_gen') +local modInfo = Mod:getInfo('smc__core__map_gen') local require = modInfo.require return require('MapGen') diff --git a/mods/CORE/MapGen/src/MapGen.lua b/mods/CORE/MapGen/src/MapGen.lua index 5c319fb..fa36be8 100644 --- a/mods/CORE/MapGen/src/MapGen.lua +++ b/mods/CORE/MapGen/src/MapGen.lua @@ -20,7 +20,7 @@ local function mglog(text, ...) core.log((text):format(...)) end -local require = Mod.getInfo('smc__core__map_gen').require +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, weight:number} diff --git a/mods/CORE/MapGen/src/MapGen/FakePeak.lua b/mods/CORE/MapGen/src/MapGen/FakePeak.lua index 215ff39..3ed991e 100644 --- a/mods/CORE/MapGen/src/MapGen/FakePeak.lua +++ b/mods/CORE/MapGen/src/MapGen/FakePeak.lua @@ -1,6 +1,6 @@ local extend = Class.extend -local require = Mod.getInfo('smc__core__map_gen').require +local require = Mod:getInfo('smc__core__map_gen').require ---@type MapGen.Peak local Peak = require('MapGen.Peak') diff --git a/mods/CORE/MapGen/src/MapGen/Layer.lua b/mods/CORE/MapGen/src/MapGen/Layer.lua index 7ef4323..e0db241 100644 --- a/mods/CORE/MapGen/src/MapGen/Layer.lua +++ b/mods/CORE/MapGen/src/MapGen/Layer.lua @@ -9,7 +9,7 @@ local corePosToString, coreGetValueNoise = core.pos_to_string, core.get_value_no local getInstance = Class.getInstance -local require = Mod.getInfo('smc__core__map_gen').require +local require = Mod:getInfo('smc__core__map_gen').require ---@type MapGen.Peak local Peak = require('MapGen.Peak') diff --git a/mods/CORE/MapGen/src/MapGen/Tree.lua b/mods/CORE/MapGen/src/MapGen/Tree.lua index 6520419..2178d75 100644 --- a/mods/CORE/MapGen/src/MapGen/Tree.lua +++ b/mods/CORE/MapGen/src/MapGen/Tree.lua @@ -32,7 +32,7 @@ function Tree:new(name, def) local intance = getInstance(self, {}) intance.name = name intance.path = def.path - intance.placerName = Mod.getInfo().shortName..':'..name..'_placer' + intance.placerName = Mod:getInfo().shortName..':'..name..'_placer' intance:registerPlacer() diff --git a/mods/CORE/MapGen/src/MapGen/Triangle.lua b/mods/CORE/MapGen/src/MapGen/Triangle.lua index 97a1ef6..ead69ba 100644 --- a/mods/CORE/MapGen/src/MapGen/Triangle.lua +++ b/mods/CORE/MapGen/src/MapGen/Triangle.lua @@ -6,7 +6,7 @@ local v = vector.new local getInstance = Class.getInstance -local require = Mod.getInfo('smc__core__map_gen').require +local require = Mod:getInfo('smc__core__map_gen').require ---@type MapGen.Edge local Edge = require('MapGen.Edge') diff --git a/mods/CORE/Node/init.lua b/mods/CORE/Node/init.lua index 03ac114..dab1cc2 100644 --- a/mods/CORE/Node/init.lua +++ b/mods/CORE/Node/init.lua @@ -1,4 +1,4 @@ -local modInfo = Mod.getInfo('smc__core__node') +local modInfo = Mod:getInfo('smc__core__node') local require = modInfo.require return require('Node') diff --git a/mods/CORE/Plant/init.lua b/mods/CORE/Plant/init.lua index fa524ab..084080f 100644 --- a/mods/CORE/Plant/init.lua +++ b/mods/CORE/Plant/init.lua @@ -1,4 +1,4 @@ -local modInfo = Mod.getInfo('smc__core__plant') +local modInfo = Mod:getInfo('smc__core__plant') local require = modInfo.require return require('Plant') \ No newline at end of file diff --git a/mods/CORE/Player/init.lua b/mods/CORE/Player/init.lua index d0996ea..2c55c0d 100644 --- a/mods/CORE/Player/init.lua +++ b/mods/CORE/Player/init.lua @@ -1,4 +1,4 @@ -local modInfo = Mod.getInfo('smc__core__player') +local modInfo = Mod:getInfo('smc__core__player') local require = modInfo.require return require('Player') diff --git a/mods/CORE/Player/src/Player.lua b/mods/CORE/Player/src/Player.lua index 8920f01..641fc4a 100644 --- a/mods/CORE/Player/src/Player.lua +++ b/mods/CORE/Player/src/Player.lua @@ -2,7 +2,7 @@ local Player = {} ---@type PlayerInventoryUI -local PlayerInventoryUI = Mod.getInfo('smc__ui__player_inventory').require('PlayerInventoryUI') +local PlayerInventoryUI = Mod:getInfo('smc__ui__player_inventory').require('PlayerInventoryUI') core.register_on_joinplayer(function(player) player:set_inventory_formspec(PlayerInventoryUI:getFormSpecString(player:get_player_name())) @@ -29,7 +29,7 @@ core.register_chatcommand('show_inv', } ) -local require = Mod.getInfo('smc__core__player').require +local require = Mod:getInfo('smc__core__player').require require('Player.inventory') diff --git a/mods/CORE/Player/src/Player/inventory.lua b/mods/CORE/Player/src/Player/inventory.lua index d3074a6..11598c4 100644 --- a/mods/CORE/Player/src/Player/inventory.lua +++ b/mods/CORE/Player/src/Player/inventory.lua @@ -1,2 +1,2 @@ ---@type PlayerInventoryUI -local PlayerInventoryUI = Mod.getInfo('smc__ui__player_inventory').require('PlayerInventoryUI') +local PlayerInventoryUI = Mod:getInfo('smc__ui__player_inventory').require('PlayerInventoryUI') diff --git a/mods/CORE/ProcessingContainerStation/init.lua b/mods/CORE/ProcessingContainerStation/init.lua index 5b206c6..a55cb7a 100644 --- a/mods/CORE/ProcessingContainerStation/init.lua +++ b/mods/CORE/ProcessingContainerStation/init.lua @@ -1,4 +1,4 @@ -local modInfo = Mod.getInfo('smc__core__processing_container_station') +local modInfo = Mod:getInfo('smc__core__processing_container_station') local require = modInfo.require return require('ProcessingContainerStation') diff --git a/mods/CORE/ProcessingFuelStation/init.lua b/mods/CORE/ProcessingFuelStation/init.lua index 5b3c26f..39cfb2d 100644 --- a/mods/CORE/ProcessingFuelStation/init.lua +++ b/mods/CORE/ProcessingFuelStation/init.lua @@ -1,4 +1,4 @@ -local modInfo = Mod.getInfo('smc__core__processing_fuel_station') +local modInfo = Mod:getInfo('smc__core__processing_fuel_station') local require = modInfo.require return require('ProcessingFuelStation') diff --git a/mods/CORE/ProcessingStation/init.lua b/mods/CORE/ProcessingStation/init.lua index 20941b8..ea5209c 100644 --- a/mods/CORE/ProcessingStation/init.lua +++ b/mods/CORE/ProcessingStation/init.lua @@ -1,4 +1,4 @@ -local modInfo = Mod.getInfo('smc__core__processing_station') +local modInfo = Mod:getInfo('smc__core__processing_station') local require = modInfo.require return require('ProcessingStation') diff --git a/mods/CORE/ProgressionSystem/init.lua b/mods/CORE/ProgressionSystem/init.lua index 271fe85..7a1d97c 100644 --- a/mods/CORE/ProgressionSystem/init.lua +++ b/mods/CORE/ProgressionSystem/init.lua @@ -1,4 +1,4 @@ -local modInfo = Mod.getInfo('smc__core__progression_system') +local modInfo = Mod:getInfo('smc__core__progression_system') local require = modInfo.require return require('ProgressionSystem') diff --git a/mods/CORE/ProgressionSystem/src/ProgressionSystem.lua b/mods/CORE/ProgressionSystem/src/ProgressionSystem.lua index 8f2fb89..45f0ffd 100644 --- a/mods/CORE/ProgressionSystem/src/ProgressionSystem.lua +++ b/mods/CORE/ProgressionSystem/src/ProgressionSystem.lua @@ -1,6 +1,6 @@ local assert = assert -local require = Mod.getInfo('smc__core__progression_system').require +local require = Mod:getInfo('smc__core__progression_system').require ---@type ProgressionSystem.Age local Age = require('ProgressionSystem.Age') diff --git a/mods/CORE/Sound/init.lua b/mods/CORE/Sound/init.lua index e6b8603..0790ea7 100644 --- a/mods/CORE/Sound/init.lua +++ b/mods/CORE/Sound/init.lua @@ -1,4 +1,4 @@ -local modInfo = Mod.getInfo('smc__core__sound') +local modInfo = Mod:getInfo('smc__core__sound') local require = modInfo.require return require('Sound') \ No newline at end of file diff --git a/mods/CORE/TileSheet/init.lua b/mods/CORE/TileSheet/init.lua index ea757a4..2293bac 100644 --- a/mods/CORE/TileSheet/init.lua +++ b/mods/CORE/TileSheet/init.lua @@ -1,4 +1,4 @@ -local modInfo = Mod.getInfo('smc__core__tilesheet') +local modInfo = Mod:getInfo('smc__core__tilesheet') local require = modInfo.require return require('TileSheet') \ No newline at end of file diff --git a/mods/CORE/Tool/init.lua b/mods/CORE/Tool/init.lua index 312f5a4..3a5c9a9 100644 --- a/mods/CORE/Tool/init.lua +++ b/mods/CORE/Tool/init.lua @@ -1,4 +1,4 @@ -local modInfo = Mod.getInfo('smc__core__tool') +local modInfo = Mod:getInfo('smc__core__tool') local require = modInfo.require return require('Tool') diff --git a/mods/ENVIRONMENT/mapGenerator/init.lua b/mods/ENVIRONMENT/mapGenerator/init.lua index 7e41ea5..5a14e40 100644 --- a/mods/ENVIRONMENT/mapGenerator/init.lua +++ b/mods/ENVIRONMENT/mapGenerator/init.lua @@ -3,7 +3,7 @@ --core.set_mapgen_setting('chunksize', '{x=2,y=10,z=2}', true) -local mapGeneneratorRequire = Mod.getInfo('smc__core__map_generator').require +local mapGeneneratorRequire = Mod:getInfo('smc__core__map_generator').require -- Main env init local mapGenerator = mapGeneneratorRequire('mapGenerator') diff --git a/mods/ENVIRONMENT/mapGenerator/src/mapGenerator.lua b/mods/ENVIRONMENT/mapGenerator/src/mapGenerator.lua index 10dbf35..e2daeae 100644 --- a/mods/ENVIRONMENT/mapGenerator/src/mapGenerator.lua +++ b/mods/ENVIRONMENT/mapGenerator/src/mapGenerator.lua @@ -3,7 +3,7 @@ local id = core.get_content_id local mathRound = math.round -local mapGenRequire = Mod.getInfo('smc__core__map_gen').require +local mapGenRequire = Mod:getInfo('smc__core__map_gen').require ---@type MapGen local MapGen = mapGenRequire('MapGen') diff --git a/mods/GAME/ITEMS/rocks/init.lua b/mods/GAME/ITEMS/rocks/init.lua index dd07d00..4d46a92 100644 --- a/mods/GAME/ITEMS/rocks/init.lua +++ b/mods/GAME/ITEMS/rocks/init.lua @@ -32,7 +32,7 @@ local function registerRock(name, y, def, staff) def = {} end - local modPrefix = Mod.getInfo().shortName..':' + local modPrefix = Mod:getInfo().shortName..':' local craftGroup = 'rocks_'..name..'_staff' -- Default rock diff --git a/mods/GAME/adminCommands/init.lua b/mods/GAME/adminCommands/init.lua index 2db1102..49964cf 100644 --- a/mods/GAME/adminCommands/init.lua +++ b/mods/GAME/adminCommands/init.lua @@ -1,8 +1,8 @@ -local modInfo = Mod.getInfo('smc__core__formspec') +local modInfo = Mod:getInfo('smc__core__formspec') local require = modInfo.require ---@type PlayerInventoryUI -local PlayerInventoryUI = Mod.getInfo('smc__ui__player_inventory').require('PlayerInventoryUI') +local PlayerInventoryUI = Mod:getInfo('smc__ui__player_inventory').require('PlayerInventoryUI') core.register_chatcommand('list', { privs = {give = true}, diff --git a/mods/SYSTEM/Events/init.lua b/mods/SYSTEM/Events/init.lua index 674b45c..fa6acac 100644 --- a/mods/SYSTEM/Events/init.lua +++ b/mods/SYSTEM/Events/init.lua @@ -1,4 +1,4 @@ -local modInfo = Mod.getInfo('smc__system__events') +local modInfo = Mod:getInfo('smc__system__events') local require = modInfo.require return require('Events') diff --git a/mods/SYSTEM/HelperLib/init.lua b/mods/SYSTEM/HelperLib/init.lua index ad6b3ba..a19de8e 100644 --- a/mods/SYSTEM/HelperLib/init.lua +++ b/mods/SYSTEM/HelperLib/init.lua @@ -1,4 +1,4 @@ -local modInfo = Mod.getInfo('smc__system__helper_lib') +local modInfo = Mod:getInfo('smc__system__helper_lib') local require = modInfo.require require('Lib') diff --git a/mods/SYSTEM/HelperLib/src/Lib.lua b/mods/SYSTEM/HelperLib/src/Lib.lua index 40a4011..3e00c89 100644 --- a/mods/SYSTEM/HelperLib/src/Lib.lua +++ b/mods/SYSTEM/HelperLib/src/Lib.lua @@ -5,7 +5,7 @@ Smc = {} ---@type boolean Smc.isAsync = false -local modInfo = Mod.getInfo('smc__system__helper_lib') +local modInfo = Mod:getInfo('smc__system__helper_lib') local doFile = modInfo.doFile -- Independent of SMC methods diff --git a/mods/SYSTEM/HelperLib/src/Lib/requires.lua b/mods/SYSTEM/HelperLib/src/Lib/requires.lua index acd62cd..c0ba07d 100644 --- a/mods/SYSTEM/HelperLib/src/Lib/requires.lua +++ b/mods/SYSTEM/HelperLib/src/Lib/requires.lua @@ -3,7 +3,7 @@ ---@return Item function Smc.requireItem() ---@type Item - local class = Mod.getInfo('smc__core__item').require('Item') + local class = Mod:getInfo('smc__core__item').require('Item') return class end @@ -11,7 +11,7 @@ end ---@return Node function Smc.requireNode() ---@type Node - local class = Mod.getInfo('smc__core__node').require('Node') + local class = Mod:getInfo('smc__core__node').require('Node') return class end @@ -19,7 +19,7 @@ end ---@return Tool function Smc.requireTool() ---@type Tool - local class = Mod.getInfo('smc__core__tool').require('Tool') + local class = Mod:getInfo('smc__core__tool').require('Tool') return class end @@ -27,7 +27,7 @@ end ---@return Plant function Smc.requirePlant() ---@type Plant - local class = Mod.getInfo('smc__core__plant').require('Plant') + local class = Mod:getInfo('smc__core__plant').require('Plant') return class end @@ -35,7 +35,7 @@ end ---@return ItemFactory function Smc.requireItemFactory() ---@type ItemFactory - local class = Mod.getInfo('smc__core__item_factory').require('ItemFactory') + local class = Mod:getInfo('smc__core__item_factory').require('ItemFactory') return class end @@ -43,7 +43,7 @@ end ---@return TileSheet function Smc.requireTileSheet() ---@type TileSheet - local class = Mod.getInfo('smc__core__tilesheet').require('TileSheet') + local class = Mod:getInfo('smc__core__tilesheet').require('TileSheet') return class end @@ -51,7 +51,7 @@ end ---@return BaseUI function Smc.requireBaseUI() ---@type BaseUI - local class = Mod.getInfo('smc__core__base_ui').require('BaseUI') + local class = Mod:getInfo('smc__core__base_ui').require('BaseUI') return class end @@ -59,7 +59,7 @@ end ---@return Formspec function Smc.requireFormspec() ---@type Formspec - local class = Mod.getInfo('smc__core__formspec').require('Formspec') + local class = Mod:getInfo('smc__core__formspec').require('Formspec') return class end @@ -67,7 +67,7 @@ end ---@return ProgressionSystem function Smc.requireProgressionSystem() ---@type ProgressionSystem - local class = Mod.getInfo('smc__core__progression_system').require('ProgressionSystem') + local class = Mod:getInfo('smc__core__progression_system').require('ProgressionSystem') return class end @@ -75,7 +75,7 @@ end ---@return CraftSystem function Smc.requireCraftSystem() ---@type CraftSystem - local class = Mod.getInfo('smc__core__craft_system').require('CraftSystem') + local class = Mod:getInfo('smc__core__craft_system').require('CraftSystem') return class end @@ -83,7 +83,7 @@ end ---@return PlayerInventoryUI function Smc.requirePlayerInventoryUI() ---@type PlayerInventoryUI - local class = Mod.getInfo('smc__ui__player_inventory').require('PlayerInventoryUI') + local class = Mod:getInfo('smc__ui__player_inventory').require('PlayerInventoryUI') return class end @@ -91,7 +91,7 @@ end ---@return BaseProcessingStation function Smc.requireBaseProcessingStation() ---@type BaseProcessingStation - local class = Mod.getInfo('smc__core__base_processing_station').require('BaseProcessingStation') + local class = Mod:getInfo('smc__core__base_processing_station').require('BaseProcessingStation') return class end @@ -99,7 +99,7 @@ end ---@return ProcessingContainerStation function Smc.requireProcessingContainerStation() ---@type ProcessingContainerStation - local class = Mod.getInfo('smc__core__processing_container_station').require('ProcessingContainerStation') + local class = Mod:getInfo('smc__core__processing_container_station').require('ProcessingContainerStation') return class end @@ -107,7 +107,7 @@ end ---@return ProcessingFuelStation function Smc.requireProcessingFuelStation() ---@type ProcessingFuelStation - local class = Mod.getInfo('smc__core__processing_fuel_station').require('ProcessingFuelStation') + local class = Mod:getInfo('smc__core__processing_fuel_station').require('ProcessingFuelStation') return class end @@ -116,7 +116,7 @@ end ---@return Events function Smc.requireEvents(eventsType) ---@type Events - local class = Mod.getInfo('smc__system__events').require('Events.'..eventsType) + local class = Mod:getInfo('smc__system__events').require('Events.'..eventsType) return class end diff --git a/mods/SYSTEM/Mod/init.lua b/mods/SYSTEM/Mod/init.lua index 5c7e2bf..cbadc12 100644 --- a/mods/SYSTEM/Mod/init.lua +++ b/mods/SYSTEM/Mod/init.lua @@ -22,7 +22,7 @@ end ---Return table with mod name, path and require function. ---@param modname? string Specify a name of mod to get its info ---@return Mod.Info -function Mod.getInfo(modname) +function Mod:getInfo(modname) local name = modname or core.get_current_modname() local shortName = getShortModName(name) local path = core.get_modpath(name) @@ -46,7 +46,7 @@ end --[[ function Mod:new() ---@type Mod - local instance = setmetatable(Mod.getInfo(), { __index = self }) + local instance = setmetatable(Mod:getInfo(), { __index = self }) return instance end diff --git a/mods/UI/PlayerInventoryUI/init.lua b/mods/UI/PlayerInventoryUI/init.lua index 3154432..c2f9a2d 100644 --- a/mods/UI/PlayerInventoryUI/init.lua +++ b/mods/UI/PlayerInventoryUI/init.lua @@ -1,4 +1,4 @@ -local modInfo = Mod.getInfo('smc__ui__player_inventory') +local modInfo = Mod:getInfo('smc__ui__player_inventory') local require = modInfo.require return require('PlayerInventoryUI') diff --git a/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI.lua b/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI.lua index 32a8563..e7306b8 100644 --- a/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI.lua +++ b/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI.lua @@ -11,7 +11,7 @@ local SmcGetActiveFormspec = Smc.getActiveFormspec local BaseUI, Formspec = Smc.requireBaseUI(), Smc.requireFormspec() -local modInfo = Mod.getInfo('smc__ui__player_inventory') +local modInfo = Mod:getInfo('smc__ui__player_inventory') local require = modInfo.require local loadFile = modInfo.loadFile diff --git a/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getCraftTab.lua b/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getCraftTab.lua index bb58a59..e59b7ce 100644 --- a/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getCraftTab.lua +++ b/mods/UI/PlayerInventoryUI/src/PlayerInventoryUI/getCraftTab.lua @@ -1,4 +1,4 @@ -local require = Mod.getInfo('smc__ui__player_inventory').require +local require = Mod:getInfo('smc__ui__player_inventory').require local getCraftTabTemplate = require('PlayerInventoryUI.baseGetCraftTab') local CraftSystem = Smc.requireCraftSystem() diff --git a/mods/UI/WorkStationUI/init.lua b/mods/UI/WorkStationUI/init.lua index de174c3..0992ec2 100644 --- a/mods/UI/WorkStationUI/init.lua +++ b/mods/UI/WorkStationUI/init.lua @@ -1,4 +1,4 @@ -local modInfo = Mod.getInfo('smc__ui__work_station') +local modInfo = Mod:getInfo('smc__ui__work_station') local require = modInfo.require return require('WorkStationUI')