Modern Lua Plugins: fix errors in mods/lord/Core/base_classes. LG-1980

This commit is contained in:
alek13
2025-09-20 05:18:44 +03:00
parent 0ca47db2ea
commit a902d67377
4 changed files with 27 additions and 21 deletions

View File

@@ -33,7 +33,7 @@ function InvRef:get_stack(list_name, i) end
--- copy stack to index i in list --- copy stack to index i in list
--- @param list_name string --- @param list_name string
--- @param i number --- @param i number
--- @param stack ItemStack --- @param stack ItemStack?
function InvRef:set_stack(list_name, i, stack) end function InvRef:set_stack(list_name, i, stack) end
--- return full list --- return full list
--- @param list_name string --- @param list_name string

View File

@@ -105,6 +105,8 @@ function Player:get_formspec_prepend(formspec) end
--- * The fields `LMB` and `RMB` are equal to `dig` and `place` respectively, --- * The fields `LMB` and `RMB` are equal to `dig` and `place` respectively,
--- and exist only to preserve backwards compatibility. --- and exist only to preserve backwards compatibility.
--- * Returns an empty table `{}` if the object is not a player. --- * Returns an empty table `{}` if the object is not a player.
---
--- @return table<string, boolean>
function Player:get_player_control() end function Player:get_player_control() end
--- returns integer with bit packed player pressed --- returns integer with bit packed player pressed
--- keys. --- keys.

View File

@@ -4,7 +4,7 @@ local HudDefinition = {
--- ---
--- The `name` field is not yet used, but should contain a description of what the HUD element represents. --- The `name` field is not yet used, but should contain a description of what the HUD element represents.
--- ---
--- @type string --- @type string?
name = "", name = "",
--- HUD element type, one of: --- HUD element type, one of:
@@ -18,11 +18,13 @@ local HudDefinition = {
--- the position is instead determined by world_pos, the world position of the waypoint. --- the position is instead determined by world_pos, the world position of the waypoint.
--- * `"compass"` - Displays an image oriented or translated according to current heading direction. --- * `"compass"` - Displays an image oriented or translated according to current heading direction.
--- * `"minimap"` - Displays a minimap on the HUD. --- * `"minimap"` - Displays a minimap on the HUD.
---
--- @type string?
type = "image", type = "image",
--- HUD element type: "image", "text", "statbar", "inventory", "waypoint", "image_waypoint". --- HUD element type: "image", "text", "statbar", "inventory", "waypoint", "image_waypoint".
--- In case both are specified (`type` and `hud_elem_type`) `type` will be used. --- In case both are specified (`type` and `hud_elem_type`) `type` will be used.
--- @deprecated --- @deprecated
--- @type string --- @type string?
hud_elem_type = "", hud_elem_type = "",
--- Position on the screen, range: `{x = 0..1, y = 0..1}`. --- Position on the screen, range: `{x = 0..1, y = 0..1}`.

View File

@@ -2089,6 +2089,8 @@ function minetest.write_json(data, styled) end
--- * Example: `serialize({foo='bar'})`, returns `'return { ["foo"] = "bar" }'` --- * Example: `serialize({foo='bar'})`, returns `'return { ["foo"] = "bar" }'`
--- ---
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5686-L5689) --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5686-L5689)
--- @param table
--- @return string
function minetest.serialize(table) end function minetest.serialize(table) end
--- Returns a table --- Returns a table
--- * Convert a string returned by `minetest.serialize` into a table --- * Convert a string returned by `minetest.serialize` into a table
@@ -2389,8 +2391,8 @@ minetest.registered_privileges = {}
-- --
--- @generic T : table --- @generic T : table
---@param value `T` --- @param value T
---@return `T` --- @return T
function table.copy(value) end function table.copy(value) end
--- @param list table --- @param list table
--- @param value any --- @param value any
@@ -2415,6 +2417,6 @@ invisibility = nil
--- https://luajit.org/ext_jit.html --- https://luajit.org/ext_jit.html
jit = {} jit = {}
-- Legacy function, should be removed after upgrading to 5.5 --- Legacy function, should be removed after upgrading to 5.5
--- @deprecated --- @deprecated
function spawn_falling_node(pos, nodename) end function spawn_falling_node(pos, nodename) end