From 146305cabe7ce381a509b663f08d270e2b68dabc Mon Sep 17 00:00:00 2001 From: alek13 Date: Mon, 26 Feb 2024 02:26:26 +0300 Subject: [PATCH] Wooden blocks: Refactoring `lottplants`: add `planks` API. Closes lord-server/lord#1236 --- definitions/ItemDefinition.lua | 2 +- definitions/NodeDefinition.lua | 2 +- minetest_types.lua | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/definitions/ItemDefinition.lua b/definitions/ItemDefinition.lua index 112e557..810f5a1 100644 --- a/definitions/ItemDefinition.lua +++ b/definitions/ItemDefinition.lua @@ -1,5 +1,5 @@ --- @class ItemDefinition -ItemDefinition = { +local ItemDefinition = { description = "", -- Can contain new lines. "\n" has to be used as new line character. -- See also: `get_description` in [`ItemStack`] diff --git a/definitions/NodeDefinition.lua b/definitions/NodeDefinition.lua index b71f17d..74a086c 100644 --- a/definitions/NodeDefinition.lua +++ b/definitions/NodeDefinition.lua @@ -1,5 +1,5 @@ --- @class NodeDefinition: ItemDefinition -NodeDefinition = { +local NodeDefinition = { drawtype = "normal", -- See "Node drawtypes" diff --git a/minetest_types.lua b/minetest_types.lua index 218df00..877d7cd 100644 --- a/minetest_types.lua +++ b/minetest_types.lua @@ -344,6 +344,8 @@ function minetest.log(level, text) end -- Environment: +--- @param name string technical node name (":"). +--- @param node_definition NodeDefinition table with node definition properties. --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4471-L4471) function minetest.register_node(name, node_definition) end --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4472-L4472) @@ -2286,12 +2288,12 @@ minetest.env = {} --- * Map of registered items, indexed by name --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5838-L5839) ---- @type table +--- @type table|ItemDefinition[] minetest.registered_items = {} --- * Map of registered node definitions, indexed by name --- --- [View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5840-L5841) ---- @type table +--- @type table|NodeDefinition[] minetest.registered_nodes = {} --- * Map of registered craft item definitions, indexed by name ---