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 CustomIngredient
Returns the backingCustomIngredient
of this ingredient if it's custom,null
otherwise.default boolean
Returns whether this ingredient always requires direct stack testing.
-
Method Details
-
getCustomIngredient
Returns the backingCustomIngredient
of this ingredient if it's custom,null
otherwise..- Returns:
- the backing
CustomIngredient
of this ingredient if it's custom,null
otherwise
-
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.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:
false
if this ingredient ignores NBT data when matching stacks,true
otherwise
-