EmmyLua -> LuaLS

This commit is contained in:
Van
2026-06-16 17:50:29 +03:00
parent 60003eea73
commit 1799d6d32e
37 changed files with 135 additions and 314 deletions

View File

@@ -1,8 +1,8 @@
---@alias Events.Callback fun(...)
---@alias Events.Type
--- 'ControlsEvents'|
--- 'ImmersiveCraftEvents'
---|'ControlsEvents'
---|'ImmersiveCraftEvents'
---@class Events : Class
---@field registeredEvents table<string, Events.Callback[]>

View File

@@ -2,7 +2,7 @@
---Each instance of such a class registers one or more nodes and implements their logic.
---
---**Note**: An instance is static for all nodes it registers.
---@interface NodeSuperClass
---@class NodeSuperClass
---@type table<string, NodeSuperClass>
local nodeSuperClasses = {}

View File

@@ -40,7 +40,7 @@ end
---@param itemName ItemStack|ItemStackString
---@return Item.ItemDefinition|Node.NodeDefinition
function Smc.getItemDefinition(itemName)
if type(itemName) == 'table' or type(itemName) == 'userdata' then
if type(itemName) ~= 'string' then
itemName = itemName:get_name()
end

View File

@@ -1,11 +1,9 @@
local math = math
---Limiting the value by minimum and maximum value.
---@param value number The value to be limited.
---@param min number Minimum limit.
---@param max number Maximum limit.
---@return number
math.clamp = function(value, min, max)
function math.clamp(value, min, max)
return math.min(math.max(value, min), max)
end

View File

@@ -58,7 +58,6 @@ end
function table.contains(t, value)
ensureArgType(t, 'table', 1, 'table.contains')
---@diagnostic disable-next-line: param-type-not-match
return tableKeyOf(t, value) ~= nil
end
@@ -415,7 +414,7 @@ end
---@generic value any
---@param list value[]
---@param value value
---@param value[]
---@return value[]
function table.remove_value(list, value)
local index = table.indexof(list, value)
while index ~= -1 do