Fzzy Config

Validated Ingredients

Ingredients can be validated, with restrictions placed on the three ways you can construct Ingredients (single item, item list, item tag)

Creation

ValidatedIngredients are constructed from one of three constructors based on the type of ingredient desired as default

// A validated Ingredient for a single item
public ValidatedIngredient validatedIngredientItem = new ValidatedIngredient(Identifier.of("oak_log"));
// A validated ingredient accepting a set of items
public ValidatedIngredient validatedIngredientList = new ValidatedIngredient(Set.of(Identifier.of("oak_log"), Identifier.of("dark_oak_log")));
// A validated ingredient utilizing a tag
public ValidatedIngredient validatedIngredientTag = new ValidatedIngredient(ItemTags.LOGS_THAT_BURN);
//get the ingredient from the holder for use in Materials etc
public Ingredient validatedIngredientIngredient = validatedIngredientItem.toIngredient();

Usage

ValidatedIngredient is not an ingredient itself, and does not hold ingredients. It lazily creates ingredients only when needed. This prevents an ingredient from being created before the source for the ingredient is ready (before a tag is populated, for example). Call toIngredient() to have the validation supply an ingredient.