Fix broken mcl_util.calculate_durability

This commit is contained in:
Elias Fleckenstein 2021-12-02 17:28:19 +01:00
parent e6b200aaf3
commit 92686e5412
No known key found for this signature in database
GPG Key ID: 06927A5199D6C9B2

View File

@ -478,7 +478,9 @@ function mcl_util.calculate_durability(itemstack)
end end
end end
end end
uses = uses or (next(itemstack:get_tool_capabilities().groupcaps) or {}).uses
local _, groupcap = next(itemstack:get_tool_capabilities().groupcaps)
uses = uses or (groupcap or {}).uses
end end
return uses or 0 return uses or 0