From 6550e3e8e2200099ddc61a1ffccd44013bab8565 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Thu, 29 Apr 2021 11:51:06 +0200 Subject: [PATCH] Add per-element armor groups --- mods/ITEMS/mcl_armor/api.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mods/ITEMS/mcl_armor/api.lua b/mods/ITEMS/mcl_armor/api.lua index b632eeca7..d58b5e666 100644 --- a/mods/ITEMS/mcl_armor/api.lua +++ b/mods/ITEMS/mcl_armor/api.lua @@ -96,6 +96,7 @@ function mcl_armor.register_set(def) local textures = def.textures or {} local previews = def.previews or {} local durabilities = def.durabilities or {} + local element_groups = def.element_groups or {} for name, element in pairs(mcl_armor.elements) do local itemname = element.name .. "_" .. def.name @@ -111,6 +112,10 @@ function mcl_armor.register_set(def) groups.mcl_armor_uses = (durabilities[name] or math.floor(def.durability * element.durability)) + 1 groups.enchantability = def.enchantability + for k, v in pairs(element_groups) do + groups[k] = v + end + minetest.register_tool(itemstring, { description = S(def.description .. " " .. (descriptions[name] or element.description)), _doc_items_longdesc = mcl_armor.longdesc,