From ddbe7c42bcbf6acc3abf1600f171f67388dbdc96 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 31 Oct 2016 02:11:10 +0100 Subject: [PATCH] Use new doc_items interface --- depends.txt | 2 +- init.lua | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/depends.txt b/depends.txt index bb641b5..b331941 100644 --- a/depends.txt +++ b/depends.txt @@ -3,4 +3,4 @@ bucket? farming? pedology? intllib? -doc_items? +doc? diff --git a/init.lua b/init.lua index a8f2818..52dc5c7 100644 --- a/init.lua +++ b/init.lua @@ -8,6 +8,7 @@ end minetest.register_tool("wateringcan:wateringcan_water", { description = S("Watering can with water"), + x_doc_items_create_entry = false, inventory_image = "wateringcan_wateringcan_water.png", wield_image = "wateringcan_wateringcan_wield.png", liquids_pointable = true, @@ -63,12 +64,14 @@ minetest.register_tool("wateringcan:wateringcan_water", { end end end, - groups = { not_in_doc = 1 }, } ) minetest.register_tool("wateringcan:wateringcan_empty", { description = S("Empty watering can"), + x_doc_items_entry_name = S("Watering can"), + x_doc_items_longdesc = 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."), + x_doc_items_usagehelp = 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."), inventory_image = "wateringcan_wateringcan_empty.png", wield_image = "wateringcan_wateringcan_wield.png", liquids_pointable = true, @@ -115,11 +118,6 @@ if minetest.get_modpath("bucket") ~= nil then }) 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")}) +if minetest.get_modpath("doc") ~= nil then 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