diff options
author | Wuzzy <almikes@aol.com> | 2016-12-12 21:17:23 +0100 |
---|---|---|
committer | Wuzzy <almikes@aol.com> | 2016-12-12 21:20:30 +0100 |
commit | 01d19237405c9439ec702e431e66c2627f255195 (patch) | |
tree | f17b85ef2b51961a8a2df2c69174dcf30f7b33ab | |
parent | 7074133a49f56132804d7e98978b33ba7fc2ff7e (diff) |
Allow to suppress hand entry (hopefully)
-rw-r--r-- | init.lua | 38 |
1 files changed, 20 insertions, 18 deletions
@@ -1020,25 +1020,27 @@ local function gather_descs() -- Add entry for the default tool (“hand”) -- Custom longdesc and usagehelp may be set by mods through the add_helptexts function local handdef = minetest.registered_items[""] - if handdef._doc_items_longdesc then - help.longdesc[""] = handdef._doc_items_longdesc - else - -- Default text - help.longdesc[""] = S("Whenever you are not wielding any item, you use the hand which acts as a tool with its own capabilities. When you are wielding an item which is not a mining tool or a weapon it will behave as if it would be the hand.") - end - if handdef._doc_items_entry_name then - item_name_overrides[""] = handdef._doc_items_entry_name + if handdef._doc_items_create_entry ~= false then + if handdef._doc_items_longdesc then + help.longdesc[""] = handdef._doc_items_longdesc + else + -- Default text + help.longdesc[""] = S("Whenever you are not wielding any item, you use the hand which acts as a tool with its own capabilities. When you are wielding an item which is not a mining tool or a weapon it will behave as if it would be the hand.") + end + if handdef._doc_items_entry_name then + item_name_overrides[""] = handdef._doc_items_entry_name + end + doc.new_entry("tools", "", { + name = item_name_overrides[""], + hidden = false, + data = { + longdesc = help.longdesc[""], + usagehelp = help.usagehelp[""], + itemstring = "", + def = handdef, + } + }) end - doc.new_entry("tools", "", { - name = item_name_overrides[""], - hidden = false, - data = { - longdesc = help.longdesc[""], - usagehelp = help.usagehelp[""], - itemstring = "", - def = handdef, - } - }) -- Add tool entries add_entries(minetest.registered_tools, "tools") |