IDE hinting: improve InvRef
This commit is contained in:
@@ -7,43 +7,67 @@ InvRef = {}
|
|||||||
function InvRef:is_empty(list_name) end
|
function InvRef:is_empty(list_name) end
|
||||||
--- get size of a list
|
--- get size of a list
|
||||||
--- @param list_name string
|
--- @param list_name string
|
||||||
|
--- @return number
|
||||||
function InvRef:get_size(list_name) end
|
function InvRef:get_size(list_name) end
|
||||||
--- set size of a list, avoid e.g. , 7*3), use , 21) --7*3 instead to avoid confusion with formspec#list
|
--- set size of a list, avoid e.g. , 7*3), use , 21) --7*3 instead to avoid confusion with formspec#list
|
||||||
--- @param list_name string
|
--- @param list_name string
|
||||||
--- @param size number
|
--- @param size number
|
||||||
|
--- @return boolean returns `false` on error (e.g. invalid `listname` or `size`)
|
||||||
function InvRef:set_size(list_name, size) end
|
function InvRef:set_size(list_name, size) end
|
||||||
--- get width of a list
|
--- get width of a list
|
||||||
--- @param list_name string
|
--- @param list_name string
|
||||||
|
--- @return number
|
||||||
function InvRef:get_width(list_name) end
|
function InvRef:get_width(list_name) end
|
||||||
--- set width of list; currently used for crafting
|
--- set width of list; currently used for crafting
|
||||||
--- @param list_name string
|
--- @param list_name string
|
||||||
|
--- @param width number
|
||||||
function InvRef:set_width(list_name, width) end
|
function InvRef:set_width(list_name, width) end
|
||||||
--- get a copy of stack index i in list
|
--- get a copy of stack index i in list
|
||||||
--- @param list_name string
|
--- @param list_name string
|
||||||
|
--- @param i number
|
||||||
|
--- @return ItemStack
|
||||||
function InvRef:get_stack(list_name, i) end
|
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 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
|
||||||
|
--- @return ItemStack[]|table<number,ItemStack>
|
||||||
function InvRef:get_list(list_name) end
|
function InvRef:get_list(list_name) end
|
||||||
--- set full list (size will not change)
|
--- set full list (size will not change)
|
||||||
--- @param list_name string
|
--- @param list_name string
|
||||||
|
--- @param list ItemStack[]|table<number,ItemStack>
|
||||||
function InvRef:set_list(list_name, list) end
|
function InvRef:set_list(list_name, list) end
|
||||||
--- return full lists. Ex: {main={ItemStack,ItemStack...}, craft={..},hand={..}...}
|
--- return full lists. Ex: {main={ItemStack,ItemStack...}, craft={..},hand={..}...}
|
||||||
|
--- @return ItemStack[][]|table<string,ItemStack[]>|table<string,table<number,ItemStack>>
|
||||||
function InvRef:get_lists() end
|
function InvRef:get_lists() end
|
||||||
--- set full lists. Ex: {main={ItemStack,ItemStack...}, craft={..},hand={..}...}
|
--- set full lists. Ex: {main={ItemStack,ItemStack...}, craft={..},hand={..}...}
|
||||||
--- @param lists table
|
--- @param lists ItemStack[][]|table<string,ItemStack[]>|table<string,table<number,ItemStack>>
|
||||||
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
|
||||||
|
--- @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
|
||||||
|
--- @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
|
||||||
--- @param list_name string
|
--- @param list_name string
|
||||||
function InvRef:contains_item(list_name, stack) end
|
--- @param stack ItemStack
|
||||||
--- take as many items as specified from the list, returns the items that were actually removed (as an ItemStack)
|
--- @param match_meta boolean If `match_meta` is false, only the items' names are compared (default: `false`).
|
||||||
|
--- @return boolean
|
||||||
|
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,
|
||||||
|
--- so attempting to remove a specific unique item this way will likely remove the wrong one -- to do that use
|
||||||
|
--- `set_stack` with an empty `ItemStack`.
|
||||||
--- @param list_name string
|
--- @param list_name string
|
||||||
|
--- @param stack ItemStack
|
||||||
|
--- @return ItemStack
|
||||||
function InvRef:remove_item(list_name, stack) end
|
function InvRef:remove_item(list_name, stack) end
|
||||||
|
|||||||
@@ -3,15 +3,19 @@ Player = {}
|
|||||||
|
|
||||||
--- @return string
|
--- @return string
|
||||||
function Player:get_player_name() end
|
function Player:get_player_name() end
|
||||||
|
--- @return InvRef
|
||||||
function Player:get_inventory() end
|
function Player:get_inventory() end
|
||||||
|
|
||||||
--TODO:
|
--TODO:
|
||||||
--- returns `""` if is not a player
|
--- returns `""` if is not a player
|
||||||
|
--- @return string
|
||||||
function Player:get_player_name() end
|
function Player:get_player_name() end
|
||||||
--- **DEPRECATED**, use get_velocity() instead.
|
--- **DEPRECATED**, use get_velocity() instead.
|
||||||
--- table {x, y, z} representing the player's instantaneous velocity in nodes/s
|
--- table {x, y, z} representing the player's instantaneous velocity in nodes/s
|
||||||
|
--- @deprecated
|
||||||
function Player:get_player_velocity() end
|
function Player:get_player_velocity() end
|
||||||
--- **DEPRECATED**, use add_velocity(vel) instead.
|
--- **DEPRECATED**, use add_velocity(vel) instead.
|
||||||
|
--- @deprecated
|
||||||
function Player:add_player_velocity(vel) end
|
function Player:add_player_velocity(vel) end
|
||||||
--- get camera direction as a unit vector
|
--- get camera direction as a unit vector
|
||||||
function Player:get_look_dir() end
|
function Player:get_look_dir() end
|
||||||
|
|||||||
Reference in New Issue
Block a user