@@ -58,7 +58,7 @@ public <T> DisplayIngredientAcceptor addIngredients(IIngredientType<T> ingredien
5858		ErrorUtil .checkNotNull (ingredientType , "ingredientType" );
5959		Preconditions .checkNotNull (ingredients , "ingredients" );
6060
61- 		List <Optional <ITypedIngredient <T >>> typedIngredients  = TypedIngredient .createUnvalidatedList ( ingredientType , ingredients );
61+ 		List <Optional <ITypedIngredient <T >>> typedIngredients  = TypedIngredient .createAndFilterInvalidList ( ingredientManager ,  ingredientType , ingredients ,  false );
6262		@ SuppressWarnings ("unchecked" )
6363		List <Optional <ITypedIngredient <?>>> castTypedIngredients  = (List <Optional <ITypedIngredient <?>>>) (Object ) typedIngredients ;
6464		this .ingredients .addAll (castTypedIngredients );
@@ -70,7 +70,7 @@ public <T> DisplayIngredientAcceptor addIngredients(IIngredientType<T> ingredien
7070	public  DisplayIngredientAcceptor  addIngredients (Ingredient  ingredient ) {
7171		Preconditions .checkNotNull (ingredient , "ingredient" );
7272
73- 		List <Optional <ITypedIngredient <ItemStack >>> typedIngredients  = TypedIngredient .createUnvalidatedList ( ingredient );
73+ 		List <Optional <ITypedIngredient <ItemStack >>> typedIngredients  = TypedIngredient .createAndFilterInvalidList ( ingredientManager ,  ingredient ,  false );
7474		@ SuppressWarnings ("unchecked" )
7575		List <Optional <ITypedIngredient <?>>> castTypedIngredients  = (List <Optional <ITypedIngredient <?>>>) (Object ) typedIngredients ;
7676		this .ingredients .addAll (castTypedIngredients );
@@ -91,7 +91,9 @@ public <T> DisplayIngredientAcceptor addIngredient(IIngredientType<T> ingredient
9191	public  <I > DisplayIngredientAcceptor  addTypedIngredient (ITypedIngredient <I > typedIngredient ) {
9292		ErrorUtil .checkNotNull (typedIngredient , "typedIngredient" );
9393
94- 		this .ingredients .add (Optional .of (typedIngredient ));
94+ 		@ SuppressWarnings ("unchecked" )
95+ 		Optional <ITypedIngredient <?>> copy  = (Optional <ITypedIngredient <?>>) (Object ) TypedIngredient .deepCopy (ingredientManager , typedIngredient );
96+ 		this .ingredients .add (copy );
9597
9698		return  this ;
9799	}
@@ -150,12 +152,10 @@ public DisplayIngredientAcceptor addOptionalTypedIngredients(List<Optional<IType
150152	}
151153
152154	private  <T > void  addIngredientInternal (IIngredientType <T > ingredientType , @ Nullable  T  ingredient ) {
153- 		if  (ingredient  == null ) {
154- 			this .ingredients .add (Optional .empty ());
155- 		} else  {
156- 			ITypedIngredient <T > typedIngredient  = TypedIngredient .createUnvalidated (ingredientType , ingredient );
157- 			this .ingredients .add (Optional .of (typedIngredient ));
158- 		}
155+ 		Optional <ITypedIngredient <T >> result  = TypedIngredient .createAndFilterInvalid (ingredientManager , ingredientType , ingredient , false );
156+ 		@ SuppressWarnings ("unchecked" )
157+ 		Optional <ITypedIngredient <?>> castResult  = (Optional <ITypedIngredient <?>>) (Object ) result ;
158+ 		this .ingredients .add (castResult );
159159	}
160160
161161	@ UnmodifiableView 
0 commit comments