Mod: .getInfo() -> :getInfo()
This commit is contained in:
@@ -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
|
local require = modInfo.require
|
||||||
|
|
||||||
return require('BaseProcessingStation')
|
return require('BaseProcessingStation')
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local modInfo = Mod.getInfo('smc__core__base_ui')
|
local modInfo = Mod:getInfo('smc__core__base_ui')
|
||||||
local require = modInfo.require
|
local require = modInfo.require
|
||||||
|
|
||||||
return require('BaseUI')
|
return require('BaseUI')
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local modInfo = Mod.getInfo('smc__core__controls')
|
local modInfo = Mod:getInfo('smc__core__controls')
|
||||||
local require = modInfo.require
|
local require = modInfo.require
|
||||||
|
|
||||||
return require('Controls')
|
return require('Controls')
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local modInfo = Mod.getInfo('smc__core__craft_system')
|
local modInfo = Mod:getInfo('smc__core__craft_system')
|
||||||
local require = modInfo.require
|
local require = modInfo.require
|
||||||
|
|
||||||
return require('CraftSystem')
|
return require('CraftSystem')
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
local tableJoin = table.join
|
local tableJoin = table.join
|
||||||
|
|
||||||
local modInfo = Mod.getInfo('smc__core__craft_system')
|
local modInfo = Mod:getInfo('smc__core__craft_system')
|
||||||
local require = modInfo.require
|
local require = modInfo.require
|
||||||
|
|
||||||
---@type CraftSystem.PrimitiveCraftHandler
|
---@type CraftSystem.PrimitiveCraftHandler
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ local assert, pairs, ipairs = assert, pairs, ipairs
|
|||||||
local tableInsert, tableSort, tableJoin = table.insert, table.sort, table.join
|
local tableInsert, tableSort, tableJoin = table.insert, table.sort, table.join
|
||||||
local stringMatch, stringLower = string.match, string_utf8.lower
|
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
|
---@type CraftSystem.BaseCraftHandler.PlayerCraftsCache
|
||||||
local PlayerCraftsCache = require('CraftSystem.BaseCraftHandler.PlayerCraftsCache')
|
local PlayerCraftsCache = require('CraftSystem.BaseCraftHandler.PlayerCraftsCache')
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ local v = vector.new
|
|||||||
local assert, ipairs, tostring = assert, ipairs, tostring
|
local assert, ipairs, tostring = assert, ipairs, tostring
|
||||||
local coreChatSendPlayer, coreItemDrop = core.chat_send_player, core.item_drop
|
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]]
|
local ImmersiveCraftEvents = Smc.requireEvents('ImmersiveCraftEvents') --[[@as Events.ImmersiveCraftEvents]]
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ local assert = assert
|
|||||||
|
|
||||||
local tableInsert, tableMerge = table.insert, table.merge
|
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
|
local require = modInfo.require
|
||||||
|
|
||||||
---@type CraftSystem.BaseCraftHandler
|
---@type CraftSystem.BaseCraftHandler
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---@type Creature
|
---@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.
|
---The entity the player interacts with during immersive crafting.
|
||||||
---@class CraftSystem.ImmersiveCraftNode : Creature
|
---@class CraftSystem.ImmersiveCraftNode : Creature
|
||||||
|
|||||||
@@ -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]]
|
local ImmersiveCraftEvents = Smc.requireEvents('ImmersiveCraftEvents') --[[@as Events.ImmersiveCraftEvents]]
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ local assert = assert
|
|||||||
local extend = Class.extend
|
local extend = Class.extend
|
||||||
local coreItemDrop = core.item_drop
|
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]]
|
local ImmersiveCraftEvents = Smc.requireEvents('ImmersiveCraftEvents') --[[@as Events.ImmersiveCraftEvents]]
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
local getInstance, extend = Class.getInstance, Class.extend
|
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
|
local require = modInfo.require
|
||||||
|
|
||||||
---@type CraftSystem.BaseCraft
|
---@type CraftSystem.BaseCraft
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ local extend = Class.extend
|
|||||||
|
|
||||||
local tableInsert, tableSort, tableJoin = table.insert, table.sort, table.join
|
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
|
local require = modInfo.require
|
||||||
|
|
||||||
---@type CraftSystem.BaseCraftHandler
|
---@type CraftSystem.BaseCraftHandler
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
local getInstance, extend = Class.getInstance, Class.extend
|
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
|
local require = modInfo.require
|
||||||
|
|
||||||
---@type CraftSystem.BaseCraft
|
---@type CraftSystem.BaseCraft
|
||||||
|
|||||||
@@ -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 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
|
local require = modInfo.require
|
||||||
|
|
||||||
---@type CraftSystem.BaseCraftHandler
|
---@type CraftSystem.BaseCraftHandler
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local modInfo = Mod.getInfo('smc__core__creature')
|
local modInfo = Mod:getInfo('smc__core__creature')
|
||||||
local require = modInfo.require
|
local require = modInfo.require
|
||||||
|
|
||||||
return require('Creature')
|
return require('Creature')
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ function Creature:new(entityDef)
|
|||||||
|
|
||||||
-- Add the short mod name prefix to the entity name.
|
-- Add the short mod name prefix to the entity name.
|
||||||
if s._add_mod_name then
|
if s._add_mod_name then
|
||||||
s._name = Mod.getInfo().shortName .. ':' .. s._name
|
s._name = Mod:getInfo().shortName .. ':' .. s._name
|
||||||
end
|
end
|
||||||
|
|
||||||
local onActivate = c.on_activate or function() end
|
local onActivate = c.on_activate or function() end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local modInfo = Mod.getInfo('smc__core__formspec')
|
local modInfo = Mod:getInfo('smc__core__formspec')
|
||||||
local require = modInfo.require
|
local require = modInfo.require
|
||||||
|
|
||||||
return require('Formspec')
|
return require('Formspec')
|
||||||
@@ -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
|
local require = modInfo.require
|
||||||
|
|
||||||
return require('ImmersiveWorkStation')
|
return require('ImmersiveWorkStation')
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ end
|
|||||||
|
|
||||||
local handler = CraftSystem:getImmersiveCraftHandler('workbench')
|
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')
|
local baseGetCraftTab = require('PlayerInventoryUI.baseGetCraftTab')
|
||||||
|
|
||||||
---@param self PlayerInventoryUI
|
---@param self PlayerInventoryUI
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local modInfo = Mod.getInfo('smc__core__item')
|
local modInfo = Mod:getInfo('smc__core__item')
|
||||||
local require = modInfo.require
|
local require = modInfo.require
|
||||||
|
|
||||||
return require('Item')
|
return require('Item')
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ end
|
|||||||
---@param itemDef Item.ItemDefinition
|
---@param itemDef Item.ItemDefinition
|
||||||
---@return ItemDefinition
|
---@return ItemDefinition
|
||||||
local function itemDefToLuantiDef(itemDef)
|
local function itemDefToLuantiDef(itemDef)
|
||||||
local modName = Mod.getInfo().shortName
|
local modName = Mod:getInfo().shortName
|
||||||
local S = core.get_translator(modName)
|
local S = core.get_translator(modName)
|
||||||
|
|
||||||
local s = itemDef.settings
|
local s = itemDef.settings
|
||||||
@@ -167,7 +167,7 @@ function Item:new(itemDef)
|
|||||||
itemDef = tableMerge(itemDef, self.defaultDef, true) --[[@as Item.ItemDefinition]]
|
itemDef = tableMerge(itemDef, self.defaultDef, true) --[[@as Item.ItemDefinition]]
|
||||||
local s = itemDef.settings
|
local s = itemDef.settings
|
||||||
|
|
||||||
local shortModName = Mod.getInfo().shortName
|
local shortModName = Mod:getInfo().shortName
|
||||||
|
|
||||||
if s._add_mod_name then
|
if s._add_mod_name then
|
||||||
s.name = shortModName .. ':' .. s.name
|
s.name = shortModName .. ':' .. s.name
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local modInfo = Mod.getInfo('smc__core__item_factory')
|
local modInfo = Mod:getInfo('smc__core__item_factory')
|
||||||
local require = modInfo.require
|
local require = modInfo.require
|
||||||
|
|
||||||
return require('ItemFactory')
|
return require('ItemFactory')
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
local modInfo = Mod.getInfo('smc__core__map_gen')
|
local modInfo = Mod:getInfo('smc__core__map_gen')
|
||||||
local require = modInfo.require
|
local require = modInfo.require
|
||||||
|
|
||||||
return require('MapGen')
|
return require('MapGen')
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ local function mglog(text, ...)
|
|||||||
core.log((text):format(...))
|
core.log((text):format(...))
|
||||||
end
|
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.
|
---Numeric values defining the surface height and climate for the node.
|
||||||
---@alias MapGen.Factors {height:number, temp:number, humidity:number, weight:number}
|
---@alias MapGen.Factors {height:number, temp:number, humidity:number, weight:number}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
local extend = Class.extend
|
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
|
---@type MapGen.Peak
|
||||||
local Peak = require('MapGen.Peak')
|
local Peak = require('MapGen.Peak')
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ local corePosToString, coreGetValueNoise = core.pos_to_string, core.get_value_no
|
|||||||
|
|
||||||
local getInstance = Class.getInstance
|
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
|
---@type MapGen.Peak
|
||||||
local Peak = require('MapGen.Peak')
|
local Peak = require('MapGen.Peak')
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ function Tree:new(name, def)
|
|||||||
local intance = getInstance(self, {})
|
local intance = getInstance(self, {})
|
||||||
intance.name = name
|
intance.name = name
|
||||||
intance.path = def.path
|
intance.path = def.path
|
||||||
intance.placerName = Mod.getInfo().shortName..':'..name..'_placer'
|
intance.placerName = Mod:getInfo().shortName..':'..name..'_placer'
|
||||||
|
|
||||||
intance:registerPlacer()
|
intance:registerPlacer()
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ local v = vector.new
|
|||||||
|
|
||||||
local getInstance = Class.getInstance
|
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
|
---@type MapGen.Edge
|
||||||
local Edge = require('MapGen.Edge')
|
local Edge = require('MapGen.Edge')
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local modInfo = Mod.getInfo('smc__core__node')
|
local modInfo = Mod:getInfo('smc__core__node')
|
||||||
local require = modInfo.require
|
local require = modInfo.require
|
||||||
|
|
||||||
return require('Node')
|
return require('Node')
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local modInfo = Mod.getInfo('smc__core__plant')
|
local modInfo = Mod:getInfo('smc__core__plant')
|
||||||
local require = modInfo.require
|
local require = modInfo.require
|
||||||
|
|
||||||
return require('Plant')
|
return require('Plant')
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
local modInfo = Mod.getInfo('smc__core__player')
|
local modInfo = Mod:getInfo('smc__core__player')
|
||||||
local require = modInfo.require
|
local require = modInfo.require
|
||||||
|
|
||||||
return require('Player')
|
return require('Player')
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
local Player = {}
|
local Player = {}
|
||||||
|
|
||||||
---@type PlayerInventoryUI
|
---@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)
|
core.register_on_joinplayer(function(player)
|
||||||
player:set_inventory_formspec(PlayerInventoryUI:getFormSpecString(player:get_player_name()))
|
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')
|
require('Player.inventory')
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
---@type PlayerInventoryUI
|
---@type PlayerInventoryUI
|
||||||
local PlayerInventoryUI = Mod.getInfo('smc__ui__player_inventory').require('PlayerInventoryUI')
|
local PlayerInventoryUI = Mod:getInfo('smc__ui__player_inventory').require('PlayerInventoryUI')
|
||||||
|
|||||||
@@ -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
|
local require = modInfo.require
|
||||||
|
|
||||||
return require('ProcessingContainerStation')
|
return require('ProcessingContainerStation')
|
||||||
|
|||||||
@@ -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
|
local require = modInfo.require
|
||||||
|
|
||||||
return require('ProcessingFuelStation')
|
return require('ProcessingFuelStation')
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local modInfo = Mod.getInfo('smc__core__processing_station')
|
local modInfo = Mod:getInfo('smc__core__processing_station')
|
||||||
local require = modInfo.require
|
local require = modInfo.require
|
||||||
|
|
||||||
return require('ProcessingStation')
|
return require('ProcessingStation')
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local modInfo = Mod.getInfo('smc__core__progression_system')
|
local modInfo = Mod:getInfo('smc__core__progression_system')
|
||||||
local require = modInfo.require
|
local require = modInfo.require
|
||||||
|
|
||||||
return require('ProgressionSystem')
|
return require('ProgressionSystem')
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
local assert = assert
|
local assert = assert
|
||||||
|
|
||||||
local require = Mod.getInfo('smc__core__progression_system').require
|
local require = Mod:getInfo('smc__core__progression_system').require
|
||||||
|
|
||||||
---@type ProgressionSystem.Age
|
---@type ProgressionSystem.Age
|
||||||
local Age = require('ProgressionSystem.Age')
|
local Age = require('ProgressionSystem.Age')
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local modInfo = Mod.getInfo('smc__core__sound')
|
local modInfo = Mod:getInfo('smc__core__sound')
|
||||||
local require = modInfo.require
|
local require = modInfo.require
|
||||||
|
|
||||||
return require('Sound')
|
return require('Sound')
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
local modInfo = Mod.getInfo('smc__core__tilesheet')
|
local modInfo = Mod:getInfo('smc__core__tilesheet')
|
||||||
local require = modInfo.require
|
local require = modInfo.require
|
||||||
|
|
||||||
return require('TileSheet')
|
return require('TileSheet')
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
local modInfo = Mod.getInfo('smc__core__tool')
|
local modInfo = Mod:getInfo('smc__core__tool')
|
||||||
local require = modInfo.require
|
local require = modInfo.require
|
||||||
|
|
||||||
return require('Tool')
|
return require('Tool')
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
--core.set_mapgen_setting('chunksize', '{x=2,y=10,z=2}', true)
|
--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
|
-- Main env init
|
||||||
local mapGenerator = mapGeneneratorRequire('mapGenerator')
|
local mapGenerator = mapGeneneratorRequire('mapGenerator')
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ local id = core.get_content_id
|
|||||||
|
|
||||||
local mathRound = math.round
|
local mathRound = math.round
|
||||||
|
|
||||||
local mapGenRequire = Mod.getInfo('smc__core__map_gen').require
|
local mapGenRequire = Mod:getInfo('smc__core__map_gen').require
|
||||||
|
|
||||||
---@type MapGen
|
---@type MapGen
|
||||||
local MapGen = mapGenRequire('MapGen')
|
local MapGen = mapGenRequire('MapGen')
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ local function registerRock(name, y, def, staff)
|
|||||||
def = {}
|
def = {}
|
||||||
end
|
end
|
||||||
|
|
||||||
local modPrefix = Mod.getInfo().shortName..':'
|
local modPrefix = Mod:getInfo().shortName..':'
|
||||||
local craftGroup = 'rocks_'..name..'_staff'
|
local craftGroup = 'rocks_'..name..'_staff'
|
||||||
|
|
||||||
-- Default rock
|
-- Default rock
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
local modInfo = Mod.getInfo('smc__core__formspec')
|
local modInfo = Mod:getInfo('smc__core__formspec')
|
||||||
local require = modInfo.require
|
local require = modInfo.require
|
||||||
|
|
||||||
---@type PlayerInventoryUI
|
---@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', {
|
core.register_chatcommand('list', {
|
||||||
privs = {give = true},
|
privs = {give = true},
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local modInfo = Mod.getInfo('smc__system__events')
|
local modInfo = Mod:getInfo('smc__system__events')
|
||||||
local require = modInfo.require
|
local require = modInfo.require
|
||||||
|
|
||||||
return require('Events')
|
return require('Events')
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local modInfo = Mod.getInfo('smc__system__helper_lib')
|
local modInfo = Mod:getInfo('smc__system__helper_lib')
|
||||||
local require = modInfo.require
|
local require = modInfo.require
|
||||||
|
|
||||||
require('Lib')
|
require('Lib')
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Smc = {}
|
|||||||
---@type boolean
|
---@type boolean
|
||||||
Smc.isAsync = false
|
Smc.isAsync = false
|
||||||
|
|
||||||
local modInfo = Mod.getInfo('smc__system__helper_lib')
|
local modInfo = Mod:getInfo('smc__system__helper_lib')
|
||||||
local doFile = modInfo.doFile
|
local doFile = modInfo.doFile
|
||||||
|
|
||||||
-- Independent of SMC methods
|
-- Independent of SMC methods
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
---@return Item
|
---@return Item
|
||||||
function Smc.requireItem()
|
function Smc.requireItem()
|
||||||
---@type Item
|
---@type Item
|
||||||
local class = Mod.getInfo('smc__core__item').require('Item')
|
local class = Mod:getInfo('smc__core__item').require('Item')
|
||||||
|
|
||||||
return class
|
return class
|
||||||
end
|
end
|
||||||
@@ -11,7 +11,7 @@ end
|
|||||||
---@return Node
|
---@return Node
|
||||||
function Smc.requireNode()
|
function Smc.requireNode()
|
||||||
---@type Node
|
---@type Node
|
||||||
local class = Mod.getInfo('smc__core__node').require('Node')
|
local class = Mod:getInfo('smc__core__node').require('Node')
|
||||||
|
|
||||||
return class
|
return class
|
||||||
end
|
end
|
||||||
@@ -19,7 +19,7 @@ end
|
|||||||
---@return Tool
|
---@return Tool
|
||||||
function Smc.requireTool()
|
function Smc.requireTool()
|
||||||
---@type Tool
|
---@type Tool
|
||||||
local class = Mod.getInfo('smc__core__tool').require('Tool')
|
local class = Mod:getInfo('smc__core__tool').require('Tool')
|
||||||
|
|
||||||
return class
|
return class
|
||||||
end
|
end
|
||||||
@@ -27,7 +27,7 @@ end
|
|||||||
---@return Plant
|
---@return Plant
|
||||||
function Smc.requirePlant()
|
function Smc.requirePlant()
|
||||||
---@type Plant
|
---@type Plant
|
||||||
local class = Mod.getInfo('smc__core__plant').require('Plant')
|
local class = Mod:getInfo('smc__core__plant').require('Plant')
|
||||||
|
|
||||||
return class
|
return class
|
||||||
end
|
end
|
||||||
@@ -35,7 +35,7 @@ end
|
|||||||
---@return ItemFactory
|
---@return ItemFactory
|
||||||
function Smc.requireItemFactory()
|
function Smc.requireItemFactory()
|
||||||
---@type ItemFactory
|
---@type ItemFactory
|
||||||
local class = Mod.getInfo('smc__core__item_factory').require('ItemFactory')
|
local class = Mod:getInfo('smc__core__item_factory').require('ItemFactory')
|
||||||
|
|
||||||
return class
|
return class
|
||||||
end
|
end
|
||||||
@@ -43,7 +43,7 @@ end
|
|||||||
---@return TileSheet
|
---@return TileSheet
|
||||||
function Smc.requireTileSheet()
|
function Smc.requireTileSheet()
|
||||||
---@type TileSheet
|
---@type TileSheet
|
||||||
local class = Mod.getInfo('smc__core__tilesheet').require('TileSheet')
|
local class = Mod:getInfo('smc__core__tilesheet').require('TileSheet')
|
||||||
|
|
||||||
return class
|
return class
|
||||||
end
|
end
|
||||||
@@ -51,7 +51,7 @@ end
|
|||||||
---@return BaseUI
|
---@return BaseUI
|
||||||
function Smc.requireBaseUI()
|
function Smc.requireBaseUI()
|
||||||
---@type BaseUI
|
---@type BaseUI
|
||||||
local class = Mod.getInfo('smc__core__base_ui').require('BaseUI')
|
local class = Mod:getInfo('smc__core__base_ui').require('BaseUI')
|
||||||
|
|
||||||
return class
|
return class
|
||||||
end
|
end
|
||||||
@@ -59,7 +59,7 @@ end
|
|||||||
---@return Formspec
|
---@return Formspec
|
||||||
function Smc.requireFormspec()
|
function Smc.requireFormspec()
|
||||||
---@type Formspec
|
---@type Formspec
|
||||||
local class = Mod.getInfo('smc__core__formspec').require('Formspec')
|
local class = Mod:getInfo('smc__core__formspec').require('Formspec')
|
||||||
|
|
||||||
return class
|
return class
|
||||||
end
|
end
|
||||||
@@ -67,7 +67,7 @@ end
|
|||||||
---@return ProgressionSystem
|
---@return ProgressionSystem
|
||||||
function Smc.requireProgressionSystem()
|
function Smc.requireProgressionSystem()
|
||||||
---@type ProgressionSystem
|
---@type ProgressionSystem
|
||||||
local class = Mod.getInfo('smc__core__progression_system').require('ProgressionSystem')
|
local class = Mod:getInfo('smc__core__progression_system').require('ProgressionSystem')
|
||||||
|
|
||||||
return class
|
return class
|
||||||
end
|
end
|
||||||
@@ -75,7 +75,7 @@ end
|
|||||||
---@return CraftSystem
|
---@return CraftSystem
|
||||||
function Smc.requireCraftSystem()
|
function Smc.requireCraftSystem()
|
||||||
---@type CraftSystem
|
---@type CraftSystem
|
||||||
local class = Mod.getInfo('smc__core__craft_system').require('CraftSystem')
|
local class = Mod:getInfo('smc__core__craft_system').require('CraftSystem')
|
||||||
|
|
||||||
return class
|
return class
|
||||||
end
|
end
|
||||||
@@ -83,7 +83,7 @@ end
|
|||||||
---@return PlayerInventoryUI
|
---@return PlayerInventoryUI
|
||||||
function Smc.requirePlayerInventoryUI()
|
function Smc.requirePlayerInventoryUI()
|
||||||
---@type PlayerInventoryUI
|
---@type PlayerInventoryUI
|
||||||
local class = Mod.getInfo('smc__ui__player_inventory').require('PlayerInventoryUI')
|
local class = Mod:getInfo('smc__ui__player_inventory').require('PlayerInventoryUI')
|
||||||
|
|
||||||
return class
|
return class
|
||||||
end
|
end
|
||||||
@@ -91,7 +91,7 @@ end
|
|||||||
---@return BaseProcessingStation
|
---@return BaseProcessingStation
|
||||||
function Smc.requireBaseProcessingStation()
|
function Smc.requireBaseProcessingStation()
|
||||||
---@type BaseProcessingStation
|
---@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
|
return class
|
||||||
end
|
end
|
||||||
@@ -99,7 +99,7 @@ end
|
|||||||
---@return ProcessingContainerStation
|
---@return ProcessingContainerStation
|
||||||
function Smc.requireProcessingContainerStation()
|
function Smc.requireProcessingContainerStation()
|
||||||
---@type ProcessingContainerStation
|
---@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
|
return class
|
||||||
end
|
end
|
||||||
@@ -107,7 +107,7 @@ end
|
|||||||
---@return ProcessingFuelStation
|
---@return ProcessingFuelStation
|
||||||
function Smc.requireProcessingFuelStation()
|
function Smc.requireProcessingFuelStation()
|
||||||
---@type ProcessingFuelStation
|
---@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
|
return class
|
||||||
end
|
end
|
||||||
@@ -116,7 +116,7 @@ end
|
|||||||
---@return Events
|
---@return Events
|
||||||
function Smc.requireEvents(eventsType)
|
function Smc.requireEvents(eventsType)
|
||||||
---@type Events
|
---@type Events
|
||||||
local class = Mod.getInfo('smc__system__events').require('Events.'..eventsType)
|
local class = Mod:getInfo('smc__system__events').require('Events.'..eventsType)
|
||||||
|
|
||||||
return class
|
return class
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ end
|
|||||||
---Return table with mod name, path and require function.
|
---Return table with mod name, path and require function.
|
||||||
---@param modname? string Specify a name of mod to get its info
|
---@param modname? string Specify a name of mod to get its info
|
||||||
---@return Mod.Info
|
---@return Mod.Info
|
||||||
function Mod.getInfo(modname)
|
function Mod:getInfo(modname)
|
||||||
local name = modname or core.get_current_modname()
|
local name = modname or core.get_current_modname()
|
||||||
local shortName = getShortModName(name)
|
local shortName = getShortModName(name)
|
||||||
local path = core.get_modpath(name)
|
local path = core.get_modpath(name)
|
||||||
@@ -46,7 +46,7 @@ end
|
|||||||
--[[
|
--[[
|
||||||
function Mod:new()
|
function Mod:new()
|
||||||
---@type Mod
|
---@type Mod
|
||||||
local instance = setmetatable(Mod.getInfo(), { __index = self })
|
local instance = setmetatable(Mod:getInfo(), { __index = self })
|
||||||
|
|
||||||
return instance
|
return instance
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local modInfo = Mod.getInfo('smc__ui__player_inventory')
|
local modInfo = Mod:getInfo('smc__ui__player_inventory')
|
||||||
local require = modInfo.require
|
local require = modInfo.require
|
||||||
|
|
||||||
return require('PlayerInventoryUI')
|
return require('PlayerInventoryUI')
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ local SmcGetActiveFormspec = Smc.getActiveFormspec
|
|||||||
|
|
||||||
local BaseUI, Formspec = Smc.requireBaseUI(), Smc.requireFormspec()
|
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 require = modInfo.require
|
||||||
local loadFile = modInfo.loadFile
|
local loadFile = modInfo.loadFile
|
||||||
|
|
||||||
|
|||||||
@@ -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 getCraftTabTemplate = require('PlayerInventoryUI.baseGetCraftTab')
|
||||||
|
|
||||||
local CraftSystem = Smc.requireCraftSystem()
|
local CraftSystem = Smc.requireCraftSystem()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
local modInfo = Mod.getInfo('smc__ui__work_station')
|
local modInfo = Mod:getInfo('smc__ui__work_station')
|
||||||
local require = modInfo.require
|
local require = modInfo.require
|
||||||
|
|
||||||
return require('WorkStationUI')
|
return require('WorkStationUI')
|
||||||
|
|||||||
Reference in New Issue
Block a user