Shears selfdrop dead bush, tall grass, fern, vine, leaves

This commit is contained in:
Wuzzy 2017-08-03 02:27:55 +02:00
parent 627d103b20
commit 54fb702c8f
5 changed files with 21 additions and 19 deletions

View file

@ -217,6 +217,21 @@ function minetest.handle_node_drops(pos, drops, digger)
return
end
--[[ Special node drops when dug by shears by reading _mcl_shears_drop
from the node definition.
Definition of _mcl_shears_drop:
* true: Drop itself when dug by shears
* table: Drop every itemstring in this table when dub by shears
]]
local nodedef = minetest.registered_nodes[dug_node.name]
if toolcaps.groupcaps and toolcaps.groupcaps.shearsy_dig and nodedef._mcl_shears_drop then
if nodedef._mcl_shears_drop == true then
drops = { dug_node.name }
else
drops = nodedef._mcl_shears_drop
end
end
for _,item in ipairs(drops) do
local count, name
if type(item) == "string" then