Interface FabricIngredient


public interface FabricIngredient
Fabric-provided extensions for Ingredient. This interface is automatically implemented on all ingredients via Mixin and interface injection.
  • Method Details

    • getCustomIngredient

      @Nullable default @Nullable CustomIngredient getCustomIngredient()
      Returns the backing CustomIngredient 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 return false, 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 using Ingredient.getMatchingItemIds().

      If true, the ingredient must always be tested using Ingredient.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