From 6c8dfbcacaa0a320bd11a1d6c4de7aaf920935f2 Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Sun, 11 Jun 2023 19:45:25 -0400 Subject: [PATCH] xdecor - fix undefined detection of 3d_armor and add support for repair of * backported https://notabug.org/minenux/minetest-mod-xdecor/commit/9f4002b749920a6aa906ce704c722c38e24ebec3 * backported https://codeberg.org/minenux/minetest-mod-xdecor/commit/9f4002b749920a6aa906ce704c722c38e24ebec3 --- mods/xdecor/init.lua | 3 ++- mods/xdecor/src/workbench.lua | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/mods/xdecor/init.lua b/mods/xdecor/init.lua index b2c333d..f41b9ce 100644 --- a/mods/xdecor/init.lua +++ b/mods/xdecor/init.lua @@ -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") diff --git a/mods/xdecor/src/workbench.lua b/mods/xdecor/src/workbench.lua index bc12333..3da902d 100644 --- a/mods/xdecor/src/workbench.lua +++ b/mods/xdecor/src/workbench.lua @@ -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