detect armor/weapons and only repair it if mod enables

master
mckaygerhard 2023-06-06 14:50:41 -04:00
parent aa199f90e4
commit 542d430537
1 changed files with 5 additions and 1 deletions

View File

@ -5,6 +5,7 @@ screwdriver = screwdriver or {}
local min, ceil = math.min, math.ceil
local S = xdecor.S
local FS = function(...) return minetest.formspec_escape(S(...)) end
local ar_api = minetest.get_modpath("3d_armor") or false
-- Nodes allowed to be cut
-- Only the regular, solid blocks without metas or explosivity can be cut
@ -34,7 +35,10 @@ workbench.defs = {
{"stair_inner", 1, nil }
}
local repairable_tools = {"pick", "axe", "shovel", "sword", "hoe", "armor", "shield"}
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 custom_repairable = {}
function xdecor:register_repairable(item)