import { EntityComponentTypes, EquipmentSlot } from "@minecraft/server";
import { ArmorType, ArmorTypeMap } from "../DATA/ArmorConfig";
export function getArmorType(player) {
    const entityEquippableComponent = player.getComponent(EntityComponentTypes.Equippable);
    const helmetType = entityEquippableComponent.getEquipment(EquipmentSlot.Head)?.typeId;
    if (helmetType) {
        const armorTypeString = helmetType.replace("_helmet", "");
        if (ArmorTypeMap.get(armorTypeString) === undefined) {
            return ArmorType.None;
        }
        const chestType = entityEquippableComponent.getEquipment(EquipmentSlot.Chest)?.typeId;
        if (chestType && chestType.startsWith(armorTypeString)) {
            const legsType = entityEquippableComponent.getEquipment(EquipmentSlot.Legs)?.typeId;
            if (legsType && legsType.startsWith(armorTypeString)) {
                const bootsType = entityEquippableComponent.getEquipment(EquipmentSlot.Feet)?.typeId;
                if (bootsType && bootsType.startsWith(armorTypeString)) {
                    return ArmorTypeMap.get(armorTypeString);
                }
            }
        }
    }
    return ArmorType.None;
}

//# sourceMappingURL=../../../../../_KiCuMountsBPDebug/kicu/mmad/U/ArmorUtility.js.map
