@Override
  public ItemStack getCraftingResult(IInventory inventory) {
    ItemStack skinStack = null;
    ItemStack blackStack = null;

    for (int slotId = 0; slotId < inventory.getSizeInventory(); slotId++) {
      ItemStack stack = inventory.getStackInSlot(slotId);
      if (stack != null) {
        Item item = stack.getItem();

        if (item == ModItems.equipmentSkin && EquipmentNBTHelper.stackHasSkinData(stack)) {
          if (skinStack != null) {
            return null;
          }
          skinStack = stack;
        } else if (item == ModItems.equipmentSkinTemplate
            & !EquipmentNBTHelper.stackHasSkinData(stack)) {
          if (blackStack != null) {
            return null;
          }
          blackStack = stack;
        } else {
          return null;
        }
      }
    }

    if (skinStack != null && blackStack != null) {
      ItemStack returnStack = new ItemStack(ModItems.equipmentSkin, 1);
      SkinPointer skinData = EquipmentNBTHelper.getSkinPointerFromStack(skinStack);
      EquipmentNBTHelper.addSkinDataToStack(returnStack, skinData.skinType, skinData.skinId, false);
      return returnStack;
    }
    return null;
  }
 @Override
 public void onCraft(IInventory inventory) {
   for (int slotId = 0; slotId < inventory.getSizeInventory(); slotId++) {
     ItemStack stack = inventory.getStackInSlot(slotId);
     Item item = stack.getItem();
     if (item == ModItems.equipmentSkinTemplate & !EquipmentNBTHelper.stackHasSkinData(stack)) {
       inventory.decrStackSize(slotId, 1);
     }
   }
 }
  @Override
  public IIcon getIcon(ItemStack stack, int pass) {
    if (pass == 1) {
      return this.loadingIcon;
    }

    if (EquipmentNBTHelper.stackHasSkinData(stack)) {
      SkinPointer skinData = EquipmentNBTHelper.getSkinPointerFromStack(stack);
      if (skinData.skinType != null) {
        if (skinData.skinType.getIcon() != null) {
          return skinData.skinType.getIcon();
        }
      }
    }

    return this.itemIcon;
  }
  public static void addTooltipToSkinItem(
      ItemStack stack, EntityPlayer player, List tooltip, boolean showAdvancedItemTooltips) {
    String cRed = EnumChatFormatting.RED.toString();

    boolean isEquipmentSkin = stack.getItem() == ModItems.equipmentSkin;
    boolean isEquipmentContainer = stack.getItem() instanceof AbstractModItemArmour;

    if (EquipmentNBTHelper.stackHasSkinData(stack)) {
      SkinPointer skinData = EquipmentNBTHelper.getSkinPointerFromStack(stack);

      if (!isEquipmentSkin & !skinData.lockSkin & !isEquipmentContainer) {
        return;
      }

      if (!isEquipmentSkin) {
        tooltip.add(TranslateUtils.translate("item.armourersworkshop:rollover.hasSkin"));
      }

      if (ClientModelCache.INSTANCE.isEquipmentInCache(skinData.skinId)) {
        Skin data = ClientModelCache.INSTANCE.getEquipmentItemData(skinData.skinId);
        if (!data.getCustomName().trim().isEmpty()) {
          tooltip.add(
              TranslateUtils.translate(
                  "item.armourersworkshop:rollover.skinName", data.getCustomName()));
        }
        if (!data.getAuthorName().trim().isEmpty()) {
          tooltip.add(
              TranslateUtils.translate(
                  "item.armourersworkshop:rollover.skinAuthor", data.getAuthorName()));
        }

        if (ConfigHandler.showSkinTooltipDebugInfo) {
          if (GuiScreen.isShiftKeyDown()) {
            if (skinData.skinType != null) {
              String localSkinName =
                  SkinTypeRegistry.INSTANCE.getLocalizedSkinTypeName(skinData.skinType);
              tooltip.add(
                  TranslateUtils.translate(
                      "item.armourersworkshop:rollover.skinType", localSkinName));
            }
            tooltip.add(
                TranslateUtils.translate(
                    "item.armourersworkshop:rollover.skinId", skinData.skinId));
            tooltip.add(
                TranslateUtils.translate(
                    "item.armourersworkshop:rollover.skinTotalCubes", data.getTotalCubes()));
            tooltip.add(
                TranslateUtils.translate(
                    "item.armourersworkshop:rollover.skinNumCubes",
                    data.getTotalOfCubeType(Cube.class)));
            tooltip.add(
                TranslateUtils.translate(
                    "item.armourersworkshop:rollover.skinNumCubesGlowing",
                    data.getTotalOfCubeType(CubeGlowing.class)));
            tooltip.add(
                TranslateUtils.translate(
                    "item.armourersworkshop:rollover.skinNumCubesGlass",
                    data.getTotalOfCubeType(CubeGlass.class)));
            tooltip.add(
                TranslateUtils.translate(
                    "item.armourersworkshop:rollover.skinNumCubesGlassGlowing",
                    data.getTotalOfCubeType(CubeGlassGlowing.class)));
            tooltip.add(
                TranslateUtils.translate(
                    "item.armourersworkshop:rollover.skinPaintData", data.hasPaintData()));
            tooltip.add(
                TranslateUtils.translate(
                    "item.armourersworkshop:rollover.skinMarkerCount", data.getMarkerCount()));
          } else {
            tooltip.add(
                TranslateUtils.translate("item.armourersworkshop:rollover.skinHoldShiftForInfo"));
          }
        }

        if (skinData.skinId != data.lightHash()) {
          tooltip.add(TranslateUtils.translate("item.armourersworkshop:rollover.skinIdError1"));
          tooltip.add(TranslateUtils.translate("item.armourersworkshop:rollover.skinIdError2"));
          tooltip.add(
              TranslateUtils.translate(
                  "item.armourersworkshop:rollover.skinIdError3",
                  data.requestId,
                  data.lightHash()));
        }
      } else {
        tooltip.add(
            TranslateUtils.translate(
                "item.armourersworkshop:rollover.skindownloading", skinData.skinId));
      }
      String keyName = Keyboard.getKeyName(Keybindings.openCustomArmourGui.getKeyCode());
      if (isEquipmentSkin) {
        tooltip.add(
            TranslateUtils.translate("item.armourersworkshop:rollover.skinOpenWardrobe", keyName));
      }
    } else {
      if (EquipmentNBTHelper.stackHasLegacySkinData(stack)) {
        tooltip.add(TranslateUtils.translate("item.armourersworkshop:rollover.skinOldType"));
      } else {
        if (isEquipmentSkin) {
          tooltip.add(TranslateUtils.translate("item.armourersworkshop:rollover.skinInvalidItem"));
        }
      }
    }
  }