void LookForRecipe() { string recipeCode = ""; // Create recipeCode for (int i = 0; i < ingredientsSlots.Count; i++) { if (!ingredientsSlots[i].HasItem()) { recipeCode += "-1"; // For empty spaces in the manual, the sign works as a delimiter } else { recipeCode += ingredientsSlots[i].ItemInSlot.ItemID; } } Recipe foundRecipe = masterRecipeTable.FindRecipe(recipeCode); if (foundRecipe) { resultSlot.SetContents(foundRecipe.Item, foundRecipe.Amount); } else { resultSlot.SetContents(null, 0); } }