Class ModsFilteringRule
java.lang.Object
com.blamejared.crafttweaker.api.recipe.replacement.type.ModsFilteringRule
- All Implemented Interfaces:
IFilteringRule,ITargetingFilter
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 RecipeHolder.id() has that mod id as the namespace.
- 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 IFilteringRuleCreates a new rule filtering recipes based on the ids of the givenMods.static IFilteringRuleCreates a new rule filtering recipes based on the given mod ids.
-
Method Details
-
of
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
Creates a new rule filtering recipes based on the ids of the givenMods.- Parameters:
mods- The mods to check for.- Returns:
- A rule carrying out what has been specified.
- Since:
- 10.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.
-