xdecor - fix undefined detection of 3d_armor and add support for repair of

* backported 9f4002b749
* backported 9f4002b749
This commit is contained in:
mckaygerhard 2023-06-11 19:45:25 -04:00
parent f587328536
commit 6c8dfbcaca
2 changed files with 14 additions and 1 deletions

View File

@ -2,6 +2,7 @@
xdecor = {}
local modpath = minetest.get_modpath("xdecor")
local ar_api = minetest.get_modpath("3d_armor")
-- Intllib
local S
@ -27,7 +28,7 @@ else
end
xdecor.S = S
xdecor.reparaible_tools = {"pick", "axe", "shovel", "sword"}
xdecor.reparaible_tools = {"pick", "axe", "shovel", "hoe"}
dofile(modpath .. "/handlers/animations.lua")
dofile(modpath .. "/handlers/helpers.lua")

View File

@ -46,6 +46,18 @@ end
function workbench:repairable(stack)
if custom_repairable[stack] then return true end
if ar_api then
for _, t in ipairs({
"armor_head",
"armor_torso",
"armor_legs",
"armor_feet",
"armor_shield",
}) do
if minetest.get_item_group(stack, t) then return true end
end
end
for _, t in ipairs(repairable_tools) do
if stack:find(t) then
return true