@Override
  public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) {
    NBTTagCompound nbt = getOrCreateTagCompound(armor);
    for (int i = 0; i < nbt.getInteger("moduleCount"); i++) {
      IArmorModule module = (IArmorModule) ModuleRegistry.getModule(nbt.getString("module" + i));

      if ((module != null) && (module.getArmorEffectType() == EnumArmorEffectType.DEFENSIVE)) {
        IDefensiveArmorModule defmodule = (IDefensiveArmorModule) module;
        return defmodule.getArmorToDisplay();
      }
    }
    return 0;
  }
  @Override
  public ArmorProperties getProperties(
      EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) {
    int priority = 0;
    int absorbRatio = 0;
    int absorbMax = 0;
    NBTTagCompound nbt = getOrCreateTagCompound(armor);

    for (int i = 0; i < nbt.getInteger("moduleCount"); i++) {
      IArmorModule module = (IArmorModule) ModuleRegistry.getModule(nbt.getString("module" + i));

      if ((module != null) && (module.getArmorEffectType() == EnumArmorEffectType.DEFENSIVE)) {
        IDefensiveArmorModule defmodule = (IDefensiveArmorModule) module;
        absorbRatio = defmodule.getDamageAbsorbRatio();
        absorbMax = defmodule.getMaxDamageAbsorb();
      }
      if (source.isUnblockable()) {
        absorbMax = 0;
        absorbRatio = 0;
      }
    }
    return new ArmorProperties(priority, absorbRatio, absorbMax);
  }