Add factoid for special shears drops

This commit is contained in:
Wuzzy 2017-08-03 03:05:41 +02:00
parent 54fb702c8f
commit 651f7f8638
1 changed files with 22 additions and 0 deletions

View File

@ -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)