summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-12-12 21:17:23 +0100
committerWuzzy <almikes@aol.com>2016-12-12 21:20:30 +0100
commit01d19237405c9439ec702e431e66c2627f255195 (patch)
treef17b85ef2b51961a8a2df2c69174dcf30f7b33ab
parent7074133a49f56132804d7e98978b33ba7fc2ff7e (diff)
Allow to suppress hand entry (hopefully)
-rw-r--r--init.lua38
1 files changed, 20 insertions, 18 deletions
diff --git a/init.lua b/init.lua
index 4b0fc40..8ab8379 100644
--- a/init.lua
+++ b/init.lua
@@ -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")