From bcf61bb96622e07a3e6a8a04b13fdb054ef321ef Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 7 Aug 2016 18:02:56 +0200 Subject: [PATCH] Add item documentation --- depends.txt | 1 + init.lua | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/depends.txt b/depends.txt index d984147..b0868f1 100644 --- a/depends.txt +++ b/depends.txt @@ -1,3 +1,4 @@ farming? pedology? intllib? +doc_items? diff --git a/init.lua b/init.lua index 6293a9f..82ce613 100644 --- a/init.lua +++ b/init.lua @@ -61,8 +61,8 @@ minetest.register_tool("wateringcan:wateringcan_water", { return newtool end end - end - + end, + groups = { not_in_doc = 1 }, } ) @@ -86,3 +86,12 @@ minetest.register_tool("wateringcan:wateringcan_empty", { end end }) + +if minetest.get_modpath("doc_items") ~= nil then + local d = S("Watering cans are used to collect a small amount of water in order to pour it on dry blocks. One filled watering can can be used 24 times, after which it has to be refilled. Watering cans don't wear out.") + local u = S("Rightclick on water (or any other block belonging to the “Water” group) to fill or refill the watering can. Rightclick with the filled can on an appropriate block (or a plant above it) to wetten it. Soil, desert sand soil, and other blocks capable of becoming wet can be wettened. The tool wear indicator of the watering can indicates the amount of water left.") + doc.sub.items.add_item_name_overrides({["wateringcan:wateringcan_empty"] = S("Watering can")}) + doc.add_entry_alias("tools", "wateringcan:wateringcan_empty", "wateringcan:wateringcan_water") + doc.sub.items.set_items_longdesc({["wateringcan:wateringcan_empty"] = d, ["wateringcan:wateringcan_water"] = d}) + doc.sub.items.set_items_usagehelp({["wateringcan:wateringcan_empty"] = u, ["wateringcan:wateringcan_water"] = u}) +end