NameFilteringRule
Link to namefilteringrule
Filters recipes that match a specific pattern on their name.
This acts as a less specialized version of ModsFilteringRule as it allows custom matching on the entirety of a recipe's name as determined by Recipe<C>#getId(), at the cost of some efficiency.
Importing the class
Link to importing-the-class
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
ZenScript Copyimport crafttweaker.api.recipe.replacement.type.NameFilteringRule;
Implemented Interfaces
Link to implemented-interfaces
NameFilteringRule implements the following interfaces. That means all methods defined in these interfaces are also available in NameFilteringRule
Static Methods
Link to static-methods
Name: anyOf
Creates a rule that filters only recipes with the specific given names.
The names are matched exactly, in both namespace and path.
Returns: A rule carrying out what has been specified.
Return Type: NameFilteringRule
ZenScript CopyNameFilteringRule.anyOf(exactNames as string[]) as NameFilteringRule
Parameter | Type | Description |
---|---|---|
Parameter exactNames | Type string[] | Description The exact names to look for. |
Name: containing
Creates a rule filtering recipes that have the given word in their name.
The word is not matched exactly and word boundaries aren't considered. This means that if a recipe is called
"minecraft:pumpkin_pie"
and the rule is set up to check "pump"
, that recipe will pass the check
instead of failing it.
Returns: A rule carrying out exactly what has been specified.
Return Type: NameFilteringRule
ZenScript CopyNameFilteringRule.containing(contents as string) as NameFilteringRule
Parameter | Type | Description |
---|---|---|
Parameter contents | Type string | Description The contents to look for in the recipe's name. |
Name: regex
Creates a rule filtering recipes based on the given regular expression.
Returns: A rule carrying out what has been specified.
Return Type: NameFilteringRule
ZenScript CopyNameFilteringRule.regex(regex as string) as NameFilteringRule
Parameter | Type | Description |
---|---|---|
Parameter regex | Type string | Description The regular expression to use. |