Interface ITypelessAdvancedIngredient<STACK>

All Superinterfaces:
Predicate<STACK>
All Known Subinterfaces:
FluidAdvancedIngredient, IAdvancedIngredient<STACK>, ItemAdvancedIngredient
All Known Implementing Classes:
BogglePatternAdvancedIngredient, CompoundAdvancedIngredient, ContaminatedAdvancedIngredient, CreateItemAttributeAdvancedIngredient, EnchantmentItemAdvancedIngredient, HolderSetFluidAdvancedIngredient, HolderSetItemAdvancedIngredient, ItemIDRegExAdvancedIngredient, ItemIngredientValueAdvancedIngredient, ItemItemAdvancedIngredient, NotAdvancedIngredient, PassAdvancedIngredient, TagItemAdvancedIngredient, TypeAttachedAdvancedIngredient

public interface ITypelessAdvancedIngredient<STACK> extends Predicate<STACK>
  • Method Details

    • streamExamples

      default Stream<? extends STACK> streamExamples()
      All (or an exemplary subset) of the stacks which fulfill this IAdvancedIngredient. This is not guaranteed to have every possible stack, and should never be used that way.
      Returns:
      Non-null, potentially empty Stream
    • streamCounterExamples

      default Stream<? extends STACK> streamCounterExamples()
      All (or an exemplary subset) of the stacks which do not fulfill this IAdvancedIngredient. This is not guaranteed to have every possible stack (and in fact will usually be empty), and should never be used that way.
      Returns:
      Non-null, potentially empty Stream
    • modifyExamples

      default Stream<STACK> modifyExamples(Stream<STACK> exampleStacks)
      Modify an example stack so it fulfill this IAdvancedIngredient.
      Parameters:
      exampleStacks - May be modified
      Returns:
      A stack fulfilling this Ingredient, possibly the same object reference, or null if that stack can never fulfill this Ingredient
    • modifyCounterExamples

      default Stream<STACK> modifyCounterExamples(Stream<STACK> counterExampleStacks)
      Modify an example stack so it does not fulfill this IAdvancedIngredient.
      Parameters:
      counterExampleStacks - May be modified
      Returns:
      A stack not fulfilling this Ingredient, possibly the same object reference, or null if that stack always fulfills this Ingredient
    • addToDescription

      void addToDescription(Lang.IndentedTooltipBuilder description)
    • addToCounterDescription

      void addToCounterDescription(Lang.IndentedTooltipBuilder description)
    • simplify

      default ITypelessAdvancedIngredient<? super STACK> simplify()
      The IAdvancedIngredient (not necessarily of the same type) which is the exact same predicate as this, but which has the smallest possible overhead. It is acceptable to mutate this Ingredient while calling this method, so careful caching the unsimplified version. Usually this will just return this.
    • checkedCast

      @Nullable default STACK checkedCast(Object stack)
      Check and cast the given object to the correct type for this Ingredient. This is just to bypass compilation problems with generics, and should only be used when you are certain the object is of the right type. Mainly for use by generic Ingredients.
      Parameters:
      stack -
      Returns:
      Potentially null