From 3103d426d2efd146b51df66925b710b2b79e5d7e Mon Sep 17 00:00:00 2001 From: Jordan Irwin Date: Wed, 7 Jul 2021 09:28:25 -0700 Subject: [PATCH] Add method to register items as repairable (#145) --- src/workbench.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/workbench.lua b/src/workbench.lua index 66567f1..09148a9 100644 --- a/src/workbench.lua +++ b/src/workbench.lua @@ -36,8 +36,15 @@ workbench.defs = { local repairable_tools = {"pick", "axe", "shovel", "sword", "hoe", "armor", "shield"} +local custom_repairable = {} +function xdecor:register_repairable(item) + custom_repairable[item] = true +end + -- Tools allowed to be repaired function workbench:repairable(stack) + if custom_repairable[stack] then return true end + for _, t in ipairs(repairable_tools) do if stack:find(t) then return true