From e8ce0976906e3b56fa41170ccf9f72a5d1619e1f Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 4 Aug 2016 00:18:32 +0200 Subject: [PATCH] Add in_doc group --- init.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 58e31d0..4e39d11 100644 --- a/init.lua +++ b/init.lua @@ -670,13 +670,14 @@ local function gather_descs() help.longdesc["air"] = "A transparent block, basically empty space. It is usually left behind after digging something." end - -- NOTE: Mod introduces group “not_in_doc”: Nodes with this group will not have entries + -- NOTE: Mod introduces group “not_in_doc”: Items with this group will not have entries + -- NOTE: New group “in_doc”: forces an entry on this item when the item would otherwise not have one -- Add node entries for id, def in pairs(minetest.registered_nodes) do local name, ld, uh local forced = false - if forced_items[id] == true and minetest.registered_nodes[id] ~= nil then forced = true end + if (forced_items[id] == true or def.groups.in_doc) and minetest.registered_nodes[id] ~= nil then forced = true end if item_name_overrides[id] ~= nil then name = item_name_overrides[id] else @@ -721,7 +722,7 @@ local function gather_descs() for id, def in pairs(minetest.registered_tools) do local name, ld, uh local forced = false - if forced_items[id] == true and minetest.registered_tools[id] ~= nil then forced = true end + if (forced_items[id] == true or def.groups.in_doc) and minetest.registered_nodes[id] ~= nil then forced = true end if item_name_overrides[id] ~= nil then name = item_name_overrides[id] else @@ -752,7 +753,7 @@ local function gather_descs() local name, ld, uh name = def.description local forced = false - if forced_items[id] == true and minetest.registered_craftitems[id] ~= nil then forced = true end + if (forced_items[id] == true or def.groups.in_doc) and minetest.registered_nodes[id] ~= nil then forced = true end if item_name_overrides[id] ~= nil then name = item_name_overrides[id] else