Modern Lua Plugins: some fixes in ide-helper, use CppCXY.emmylua-codestyle as default codde formatter, ignore tmp-svript. LG-1978 LG-1980 LG-1991

This commit is contained in:
alek13
2025-09-24 18:47:26 +03:00
parent a2eb6da285
commit 9027db1e79
3 changed files with 24 additions and 15 deletions

View File

@@ -51,29 +51,34 @@ function InvRef:get_lists() end
function InvRef:set_lists(lists) end function InvRef:set_lists(lists) end
--- add item somewhere in list, returns leftover ItemStack --- add item somewhere in list, returns leftover ItemStack
--- @param list_name string --- @param list_name string
--- @param stack ItemStack --- @param stack ItemStack|ItemStackString
--- @return ItemStack leftover ItemStack --- @return ItemStack leftover ItemStack
function InvRef:add_item(list_name, stack) end function InvRef:add_item(list_name, stack) end
--- returns true if the stack of items can be fully added to the list --- returns true if the stack of items can be fully added to the list
--- @param list_name string --- @param list_name string
--- @param stack ItemStack --- @param stack ItemStack|ItemStackString
---
--- @return boolean --- @return boolean
function InvRef:room_for_item(list_name, stack) end function InvRef:room_for_item(list_name, stack) end
--- returns true if the stack of items can be fully taken from the list --- returns true if the stack of items can be fully taken from the list
--- @overload fun(list_name:string, stack:ItemStack):boolean --- @overload fun(list_name:string, stack:ItemStack):boolean
--- @param list_name string --- @param list_name string
--- @param stack ItemStack --- @param stack ItemStack|ItemStackString
--- @param match_meta boolean If `match_meta` is false, only the items' names are compared (default: `false`). --- @param match_meta boolean If `match_meta` is false, only the items' names are compared (default: `false`).
--- @return boolean --- @return boolean
function InvRef:contains_item(list_name, stack, match_meta) end function InvRef:contains_item(list_name, stack, match_meta) end
--- take as many items as specified from the list, returns the items that were actually removed (as an ItemStack).
--- note that any item metadata is ignored, --- Take as many items as specified from the list, returns the items that were actually removed (as an ItemStack).
--- so attempting to remove a specific unique item this way will likely remove the wrong one -- to do that use --- - If match_meta is true (available since feature `remove_item_match_meta`), item metadata is also considered when comparing items.
--- `set_stack` with an empty `ItemStack`. --- Otherwise, only the items names are compared. Default: `false``
--- @param list_name string --- - The method ignores wear.
--- @param stack ItemStack ---
--- @param list_name string
--- @param stack ItemStack|ItemStackString
--- @param match_meta? boolean since `remove_item_match_meta`
---
--- @return ItemStack --- @return ItemStack
function InvRef:remove_item(list_name, stack) end function InvRef:remove_item(list_name, stack, match_meta) end
--- returns a location compatible to `minetest.get_inventory(location)`. e.g. --- returns a location compatible to `minetest.get_inventory(location)`. e.g.
--- * `{type="player", name="celeron55"}` --- * `{type="player", name="celeron55"}`
--- * `{type="node", pos={x=, y=, z=}}` --- * `{type="node", pos={x=, y=, z=}}`

View File

@@ -7,12 +7,12 @@
--- @operator sub(vector): vector --- @operator sub(vector): vector
--- @operator mul(number): vector --- @operator mul(number): vector
--- @operator div(number): vector --- @operator div(number): vector
local vector = {} vector = {}
--- Creates a new vector `(a, b, c)`. --- Creates a new vector `(a, b, c)`.
--- * Deprecated: `vector.new()` does the same as `vector.zero()` and --- * Deprecated: `vector.new()` does the same as `vector.zero()` and
--- `vector.new(v)` does the same as `vector.copy(v)` --- `vector.new(v)` does the same as `vector.copy(v)`
--- @param x number --- @param x number|Position
--- @param y? number --- @param y? number
--- @param z? number --- @param z? number
--- @return vector --- @return vector
@@ -180,9 +180,10 @@ function vector:subtract(x) end
--- Returns a scaled vector. --- Returns a scaled vector.
--- - Deprecated: If `scalar` is a vector: Returns the Schur product. --- - Deprecated: If `scalar` is a vector: Returns the Schur product.
--- @param self vector
--- @param scalar number|vector --- @param scalar number|vector
--- @return vector --- @return vector
function vector:multiply(scalar) end function vector.multiply(self, scalar) end
--- Returns a scaled vector. --- Returns a scaled vector.
--- - Deprecated: If `scalar` is a vector: Returns the Schur quotient. --- - Deprecated: If `scalar` is a vector: Returns the Schur quotient.

View File

@@ -58,7 +58,10 @@ PseudoRandom = {}
-- `minetest.` / `core.` functions -- `minetest.` / `core.` functions
-- --
minetest = {} core = {}
--- for backward compatibilit
--- @legacy
minetest = core
-- Escape sequences: -- Escape sequences:
@@ -1695,7 +1698,7 @@ function minetest.item_place(itemstack, placer, pointed_thing, param2) end
--- * returns the leftover itemstack --- * returns the leftover itemstack
--- ---
--- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5376-L5378) --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5376-L5378)
--- @param itemstack ItemStack --- @param itemstack ItemStack|ItemStackString
--- @param dropper Player|ObjectRef --- @param dropper Player|ObjectRef
--- @param pos Position --- @param pos Position
--- @return ItemStack --- @return ItemStack