+ -- This isn't just legacy, but more of a convenience feature
+ local toolcaps = tooldef.tool_capabilities
+ if toolcaps and toolcaps.punch_attack_uses == nil then
+ for _, cap in pairs(toolcaps.groupcaps or {}) do
+ local level = (cap.maxlevel or 0) - 1
+ if (cap.uses or 0) ~= 0 and level >= 0 then
+ toolcaps.punch_attack_uses = cap.uses * (3 ^ level)
+ break
+ end
+ end
+ end
+