Invalid leaf directive! `since`

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.

Importare la Classe

Link to importare-la-classe

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
Copy
import crafttweaker.api.recipe.replacement.type.NameFilteringRule;

Interfacce Implementate

Link to interfacce-implementate

NameFilteringRule implements the following interfaces. That means all methods defined in these interfaces are also available in NameFilteringRule

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
Copy
NameFilteringRule.anyOf(exactNames as string[]) as NameFilteringRule
ParametroTipoDescrizione
Parametro
exactNames
Tipo
string[]
Descrizione
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
Copy
NameFilteringRule.containing(contents as string) as NameFilteringRule
ParametroTipoDescrizione
Parametro
contents
Tipo
string
Descrizione
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
Copy
NameFilteringRule.regex(regex as string) as NameFilteringRule
ParametroTipoDescrizione
Parametro
regex
Tipo
string
Descrizione
The regular expression to use.