mirror of
https://github.com/joe7575/lumberjack.git
synced 2024-11-19 21:43:46 +01:00
Toolranks: update item count
This commit is contained in:
parent
c9352cc79a
commit
e0b9b4b503
3
init.lua
3
init.lua
@ -91,6 +91,9 @@ local function add_wear(digger, node, num_nodes)
|
||||
local uses = caps.groupcaps.choppy.uses or 10
|
||||
uses = uses * 9
|
||||
if minetest.global_exists("toolranks") then
|
||||
local itemmeta = tool:get_meta()
|
||||
local dugnodes = tonumber(itemmeta:get_string("dug")) or 0
|
||||
itemmeta:set_string("dug", dugnodes + num_nodes - 1)
|
||||
toolranks.new_afteruse(tool, digger, node, {wear = uses})
|
||||
end
|
||||
tool:add_wear(65535 * num_nodes / uses)
|
||||
|
Loading…
Reference in New Issue
Block a user