public void smeltItem() {
    if (!canSmelt()) {
      return;
    }
    ItemStack itemstack =
        ElectrolysisMachineRecipes.getSmeltingResult(
            electrolysisItemStacks[0].getItem().itemID,
            electrolysisItemStacks[1].getItem().itemID,
            electrolysisItemStacks[1].stackSize);
    if (electrolysisItemStacks[3] == null) {
      electrolysisItemStacks[3] = itemstack.copy();
    } else if (electrolysisItemStacks[3] != null) {
      if (electrolysisItemStacks[4] == null) {
        electrolysisItemStacks[4] = itemstack.copy();
      } else if (electrolysisItemStacks[4] != null) {
        if (electrolysisItemStacks[5] == null) {
          electrolysisItemStacks[5] = itemstack.copy();
        }
      }
    }
    /*else if (electrolysisItemStacks[3].itemID == itemstack.itemID)
    {
            electrolysisItemStacks[3].stackSize++;
    }*/
    if (electrolysisItemStacks[0].stackSize <= 0) {
      electrolysisItemStacks[0] = new ItemStack(electrolysisItemStacks[0].getItem().setFull3D());
    } else {
      ElectrolysisMachineRecipes recipes;
      electrolysisItemStacks[0].stackSize--;
    }
    if (electrolysisItemStacks[0].stackSize <= 0) {
      electrolysisItemStacks[0] = null;
    }

    if (electrolysisItemStacks[1].stackSize <= 0) {
      electrolysisItemStacks[1] = new ItemStack(electrolysisItemStacks[1].getItem().setFull3D());
    } else {
      for (int x = 0; x < ElectrolysisMachineRecipes.cellOutputElectrolysis; x++) {
        electrolysisItemStacks[1].stackSize--;
      }
    }
    if (electrolysisItemStacks[1].stackSize <= 0) {
      electrolysisItemStacks[1] = null;
    }
  }
 private boolean canSmelt() {
   if (electrolysisItemStacks[0] == null || electrolysisItemStacks[1] == null) {
     return false;
   }
   ItemStack itemstack =
       ElectrolysisMachineRecipes.getSmeltingResult(
           electrolysisItemStacks[0].getItem().itemID,
           electrolysisItemStacks[1].getItem().itemID,
           electrolysisItemStacks[1].stackSize);
   if (itemstack == null) {
     return false;
   }
   if (electrolysisItemStacks[3] == null) {
     return true;
   }
   if (electrolysisItemStacks[4] == null) {
     return true;
   }
   if (electrolysisItemStacks[5] == null) {
     return true;
   }
   if (electrolysisItemStacks[3] != null
       && electrolysisItemStacks[4] != null
       && electrolysisItemStacks[5] != null) {
     return false;
   }
   /*if (!electrolysisItemStacks[3].isItemEqual(itemstack))
   {
    return false;
   }
   if (electrolysisItemStacks[3].stackSize < getInventoryStackLimit() && electrolysisItemStacks[3].stackSize < electrolysisItemStacks[3].getMaxStackSize())
   {
    return true;
   }*/
   else {
     // return electrolysisItemStacks[3].stackSize < itemstack.getMaxStackSize();
     return false;
   }
 }