From 651f7f86384dd3a1a8965f79960d7da8cd49ad89 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 3 Aug 2017 03:05:41 +0200 Subject: [PATCH] Add factoid for special shears drops --- mods/HELP/mcl_doc/init.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/mods/HELP/mcl_doc/init.lua b/mods/HELP/mcl_doc/init.lua index 6dfd013dcf..ba959927df 100644 --- a/mods/HELP/mcl_doc/init.lua +++ b/mods/HELP/mcl_doc/init.lua @@ -181,4 +181,26 @@ doc.sub.items.register_factoid("nodes", "mining", function(itemstring, def) return datastring end) +-- Special drops when mined by shears +doc.sub.items.register_factoid("nodes", "drops", function(itemstring, def) + if def._mcl_shears_drop == true then + return "This block drops itself when mined by shears." + elseif type(def._mcl_shears_drop) == "table" then + local drops = {} + for i=1, #def._mcl_shears_drop do + local desc = minetest.registered_items[def._mcl_shears_drop[i]].description + if desc then + table.insert(drops) + else + table.insert(def._mcl_shears_drop[i]) + end + end + local ret = string.format("This blocks drops the following when mined by shears: %s", table.concat(drops, ", ")) + return ret + end + return "" +end) + + + -- TODO: Blast resistance (omitted for now because explosions ignore hardness)