Interface FabricIngredient
public interface FabricIngredient
Fabric-provided extensions for
Ingredient.
This interface is automatically implemented on all ingredients via Mixin and interface injection.-
Method Summary
Modifier and TypeMethodDescriptiondefault @Nullable CustomIngredientReturns the backingCustomIngredientof this ingredient if it's custom,nullotherwise.default booleanReturns whether this ingredient always requires direct stack testing.
-
Method Details
-
getCustomIngredient
Returns the backingCustomIngredientof this ingredient if it's custom,nullotherwise..- Returns:
- the backing
CustomIngredientof this ingredient if it's custom,nullotherwise
-
requiresTesting
default boolean requiresTesting()Returns whether this ingredient always requires direct stack testing. Vanilla ingredients will always returnfalse, and custom ingredients need to provide this information.If
false, testing this ingredient with an item stack must be equivalent to checking whether the item stack's item is included in the ingredient's list of matching stacks. In that case, optimized matching logic can be used, for example usingIngredient.getMatchingItemIds().If
true, the ingredient must always be tested usingIngredient.test(ItemStack). Note that Fabric patches some vanilla systems such as shapeless recipes to account for this.- Returns:
falseif this ingredient ignores NBT data when matching stacks,trueotherwise
-