From a8f6befd398cb8f962f3bb1fab092d6355bfe015 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Wed, 17 Feb 2021 18:53:44 +0000 Subject: Fix short_description fallback order (#10943) --- doc/lua_api.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'doc/lua_api.txt') diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 7b7825614..a09b98924 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -6039,18 +6039,18 @@ an itemstring, a table or `nil`. stack). * `set_metadata(metadata)`: (DEPRECATED) Returns true. * `get_description()`: returns the description shown in inventory list tooltips. - * The engine uses the same as this function for item descriptions. + * The engine uses this when showing item descriptions in tooltips. * Fields for finding the description, in order: * `description` in item metadata (See [Item Metadata].) * `description` in item definition * item name -* `get_short_description()`: returns the short description. +* `get_short_description()`: returns the short description or nil. * Unlike the description, this does not include new lines. - * The engine uses the same as this function for short item descriptions. * Fields for finding the short description, in order: * `short_description` in item metadata (See [Item Metadata].) * `short_description` in item definition - * first line of the description (See `get_description()`.) + * first line of the description (From item meta or def, see `get_description()`.) + * Returns nil if none of the above are set * `clear()`: removes all items from the stack, making it empty. * `replace(item)`: replace the contents of this stack. * `item` can also be an itemstring or table. @@ -7171,8 +7171,9 @@ Used by `minetest.register_node`, `minetest.register_craftitem`, and short_description = "Steel Axe", -- Must not contain new lines. - -- Defaults to the first line of description. - -- See also: `get_short_description` in [`ItemStack`] + -- Defaults to nil. + -- Use an [`ItemStack`] to get the short description, eg: + -- ItemStack(itemname):get_short_description() groups = {}, -- key = name, value = rating; rating = 1..3. -- cgit v1.2.3