mirror of
https://github.com/joe7575/lumberjack.git
synced 2024-11-22 15:03:45 +01:00
Merge pull request #15 from mazes-80/toolranks
Toolranks: update item count
This commit is contained in:
commit
5e5a18b05f
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