Class CustomFilteringRule
- All Implemented Interfaces:
IFilteringRule,ITargetingFilter
- Since:
- 10.0.0
-
Method Summary
Modifier and TypeMethodDescriptionStream<net.minecraft.world.item.crafting.RecipeHolder<?>> castFilter(Stream<net.minecraft.world.item.crafting.RecipeHolder<?>> allRecipes) Casts the filter onto the givenStreamofRecipes.describe()Describes the actions of this filtering rule in a human-readable form, for log output.static CustomFilteringRuleof(BiPredicate<IRecipeManager<?>, net.minecraft.world.item.crafting.RecipeHolder<?>> predicate) Creates a new rule filtering recipes based on the givenBiPredicate.static CustomFilteringRuleCreates a new rule filtering recipes based on the givenPredicate.static CustomFilteringRuleofZen(BiPredicate<IRecipeManager<net.minecraft.world.item.crafting.Recipe<net.minecraft.world.item.crafting.RecipeInput>>, net.minecraft.world.item.crafting.RecipeHolder<net.minecraft.world.item.crafting.Recipe<net.minecraft.world.item.crafting.RecipeInput>>> predicate) Creates a new rule filtering recipes based on the givenBiPredicate.static CustomFilteringRuleofZen(Predicate<net.minecraft.world.item.crafting.RecipeHolder<net.minecraft.world.item.crafting.Recipe<net.minecraft.world.item.crafting.RecipeInput>>> predicate) Creates a new rule filtering recipes based on the givenPredicate.
-
Method Details
-
of
public static CustomFilteringRule of(Predicate<net.minecraft.world.item.crafting.RecipeHolder<?>> predicate) Creates a new rule filtering recipes based on the givenPredicate.The predicate gets access to the
Recipeinstance directly, allowing for it to check directly elements that might be required.- Parameters:
predicate- The predicate for checking.- Returns:
- A rule carrying out what has been specified.
- Since:
- 10.0.0
-
of
public static CustomFilteringRule of(BiPredicate<IRecipeManager<?>, net.minecraft.world.item.crafting.RecipeHolder<?>> predicate) Creates a new rule filtering recipes based on the givenBiPredicate.The predicate's first argument represents the
IRecipeManagerused by the recipe, whereas the second argument is theRecipeinstance directly, allowing for it to check properties that might be required or perform additional manager-specific lookups.- Parameters:
predicate- The predicate for checking.- Returns:
- A rule carrying out what has been specified.
- Since:
- 10.0.0
-
ofZen
public static CustomFilteringRule ofZen(Predicate<net.minecraft.world.item.crafting.RecipeHolder<net.minecraft.world.item.crafting.Recipe<net.minecraft.world.item.crafting.RecipeInput>>> predicate) Creates a new rule filtering recipes based on the givenPredicate.The predicate gets access to the
Recipeinstance directly, allowing for it to check directly elements that might be required.- Parameters:
predicate- The predicate for checking.- Returns:
- A rule carrying out what has been specified.
- Since:
- 11.0.0
-
ofZen
public static CustomFilteringRule ofZen(BiPredicate<IRecipeManager<net.minecraft.world.item.crafting.Recipe<net.minecraft.world.item.crafting.RecipeInput>>, net.minecraft.world.item.crafting.RecipeHolder<net.minecraft.world.item.crafting.Recipe<net.minecraft.world.item.crafting.RecipeInput>>> predicate) Creates a new rule filtering recipes based on the givenBiPredicate.The predicate's first argument represents the
IRecipeManagerused by the recipe, whereas the second argument is theRecipeinstance directly, allowing for it to check properties that might be required or perform additional manager-specific lookups.- Parameters:
predicate- The predicate for checking.- Returns:
- A rule carrying out what has been specified.
- Since:
- 11.0.0
-
castFilter
public Stream<net.minecraft.world.item.crafting.RecipeHolder<?>> castFilter(Stream<net.minecraft.world.item.crafting.RecipeHolder<?>> allRecipes) Description copied from interface:ITargetingFilterCasts the filter onto the givenStreamofRecipes.The filter can perform any operation required, which range from filtering, to simple mapping, to peeking as needed.
- Specified by:
castFilterin interfaceITargetingFilter- Parameters:
allRecipes- TheStreamthat needs to be filtered.- Returns:
- The mutated stream.
-
describe
Description copied from interface:IFilteringRuleDescribes the actions of this filtering rule in a human-readable form, for log output.- Specified by:
describein interfaceIFilteringRule- Returns:
- A human-readable description of this rule.
-