java.lang.Object
com.blamejared.crafttweaker.api.recipe.replacement.type.ModsFilteringRule
All Implemented Interfaces:
IFilteringRule, ITargetingFilter

@ZenRegister public final class ModsFilteringRule extends Object implements IFilteringRule
Filters recipes that have been created by the given set of mods.

Every mod is identified according to its mod id. Recipes have been created by a mod if their name as determined by Recipe.getId() has that mod id as the namespace.

Since:
10.0.0
  • Method Details

    • of

      public static IFilteringRule of(String... modIds)
      Creates a new rule filtering recipes based on the given mod ids.
      Parameters:
      modIds - The mod ids to check for.
      Returns:
      A rule carrying out what has been specified.
      Since:
      10.0.0
    • of

      public static IFilteringRule of(Mod... mods)
      Creates a new rule filtering recipes based on the ids of the given Mods.
      Parameters:
      mods - The mods to check for.
      Returns:
      A rule carrying out what has been specified.
      Since:
      10.0.0
    • castFilter

      public Stream<? extends net.minecraft.world.item.crafting.Recipe<?>> castFilter(Stream<? extends net.minecraft.world.item.crafting.Recipe<?>> allRecipes)
      Description copied from interface: ITargetingFilter
      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.

      Specified by:
      castFilter in interface ITargetingFilter
      Parameters:
      allRecipes - The Stream that needs to be filtered.
      Returns:
      The mutated stream.
    • describe

      public String describe()
      Description copied from interface: IFilteringRule
      Describes the actions of this filtering rule in a human-readable form, for log output.
      Specified by:
      describe in interface IFilteringRule
      Returns:
      A human-readable description of this rule.