public static void MyAdd(this List <Recipe> list, ItemType input, ItemType output, Scp914Knob setting) { Recipe recipe; if ((recipe = list.FirstOrDefault(r => r.Setting == setting && r.Input.Contains(input.GetItemInfo()) && r.Output.Contains(output.GetItemInfo()))) != null) { recipe.Weight++; } else { list.Add(new Recipe(input.GetItemInfo(), output.GetItemInfo(), setting)); counter++; } }