forked from mtcontrib/pipeworks
Let stack of projectiles diminish in node breaker
The logic that prevents mechanically wearing a tool was also preventing the diminution of a stack of items to use, such as a stack of snowballs. Restrict the use of pickcopy to the case where the stack still has the same item type, count, and metadata.
This commit is contained in:
parent
aee9f7e6d6
commit
22eb00e5d1
|
@ -179,7 +179,8 @@ local function break_node (pos, facedir)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
if pickdef and (not pickdef.wear_represents or pickdef.wear_represents == "mechanical_wear") then
|
local newpick = inv:get_stack(pick_inv, 1)
|
||||||
|
if newpick:get_name() == pickcopy:get_name() and newpick:get_count() == pickcopy:get_count() and newpick:get_metadata() == pickcopy:get_metadata() and pickdef and (not pickdef.wear_represents or pickdef.wear_represents == "mechanical_wear") then
|
||||||
inv:set_stack(pick_inv, 1, pickcopy) -- Do not wear pick out
|
inv:set_stack(pick_inv, 1, pickcopy) -- Do not wear pick out
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user