diff --git a/init.lua b/init.lua index 79d63aa..b2c333d 100644 --- a/init.lua +++ b/init.lua @@ -27,12 +27,16 @@ else end xdecor.S = S +xdecor.reparaible_tools = {"pick", "axe", "shovel", "sword"} dofile(modpath .. "/handlers/animations.lua") dofile(modpath .. "/handlers/helpers.lua") dofile(modpath .. "/handlers/nodeboxes.lua") dofile(modpath .. "/handlers/registration.lua") +if ar_api then xdecor.repairable_tools = {"pick", "axe", "shovel", "sword", "hoe", "armor", "shield"} +else xdecor.repairable_tools = {"pick", "axe", "shovel", "hoe"} end + dofile(modpath .. "/src/nodes.lua") dofile(modpath .. "/src/recipes.lua") diff --git a/src/enchanting.lua b/src/enchanting.lua index 508d42e..5a76ce8 100644 --- a/src/enchanting.lua +++ b/src/enchanting.lua @@ -92,10 +92,7 @@ end function enchanting.on_put(pos, listname, _, stack) if listname == "tool" then local stackname = stack:get_name() - local tool_groups = { - "axe, pick, shovel", - "sword", - } + local tool_groups = xdecor.reparaible_tools for idx, tools in ipairs(tool_groups) do if tools:find(stackname:match(":(%w+)")) then diff --git a/src/workbench.lua b/src/workbench.lua index 09d28de..bc12333 100644 --- a/src/workbench.lua +++ b/src/workbench.lua @@ -35,10 +35,7 @@ workbench.defs = { {"stair_inner", 1, nil } } -local repairable_tools = {"pick", "axe", "shovel"} - -if ar_api then repairable_tools = {"pick", "axe", "shovel", "sword", "hoe", "armor", "shield"} -else repairable_tools = {"pick", "axe", "shovel", "hoe"} end +local repairable_tools = xdecor.reparaible_tools local custom_repairable = {} function xdecor:register_repairable(item)