Interface ITargetingFilter

All Known Subinterfaces:
IFilteringRule
All Known Implementing Classes:
ComponentFilteringRule, CustomFilteringRule, ModsFilteringRule, NameFilteringRule, NotFilteringRule, TypeFilteringRule

@ZenRegister public interface ITargetingFilter
Represents a filter applied to the recipe list.

This filter is applied to Replacer instances and allows for the removal of certain set of recipes from being able to be inspected by a replacer, or for additional global executions to be performed. Note that the filter is positive, meaning that the filter determines which recipes are allowed to be examined by a replacer, not the opposite.

Script writers should refer to IFilteringRule instead.

This is a FunctionalInterface whose functional method is castFilter(Stream).

Since:
10.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Stream<net.minecraft.world.item.crafting.RecipeHolder<?>>
    castFilter(Stream<net.minecraft.world.item.crafting.RecipeHolder<?>> allRecipes)
    Casts the filter onto the given Stream of Recipes.
  • Method Details

    • castFilter

      Stream<net.minecraft.world.item.crafting.RecipeHolder<?>> castFilter(Stream<net.minecraft.world.item.crafting.RecipeHolder<?>> allRecipes)
      Casts the filter onto the given Stream of Recipes.

      The filter can perform any operation required, which range from filtering, to simple mapping, to peeking as needed.

      Parameters:
      allRecipes - The Stream that needs to be filtered.
      Returns:
      The mutated stream.
      Since:
      10.0.0