ComponentFilteringRule<T : Object>
Link to componentfilteringrulet--object
Filters recipes that have the specified IRecipeComponent<T>, optionally with a check on its value.
In other words, to be able to be processed by the replacer, the target recipe must have the specified IRecipeComponent<T>. Optionally, the value of the component must match a specific value or a Predicate<T> to match, for more custom filtering. The value of the recipe component can be checked with any ITargetingStrategy.
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 Copyimport crafttweaker.api.recipe.replacement.type.ComponentFilteringRule;
Interfacce Implementate
Link to interfacce-implementate
ComponentFilteringRule implements the following interfaces. That means all methods defined in these interfaces are also available in ComponentFilteringRule
Static Methods
Link to static-methods
Name: of
Creates a new rule that filters recipes that have the given IRecipeComponent<T>.
The value of the component is not checked, merely its presence.
Returns: A rule carrying out what has been specified.
Return Type: ComponentFilteringRule<T>
ZenScript CopyComponentFilteringRule.of<T : Object>(component as IRecipeComponent<T>) as ComponentFilteringRule<T>
Parametro | Tipo | Descrizione |
---|---|---|
Parametro component | Tipo IRecipeComponent<T> | Descrizione The component to check for. |
Parametro T | Tipo Object | Descrizione The type of the object pointed to by the component. |
Name: of
Creates a new rule that filters recipes that have the given IRecipeComponent<T> and whose value matches the
given content
.
The strategy used is the default one, so components will be checked directly.
Returns: A rule carrying out what has been specified.
Return Type: ComponentFilteringRule<T>
ZenScript CopyComponentFilteringRule.of<T : Object>(component as IRecipeComponent<T>, content as T) as ComponentFilteringRule<T>
Parametro | Tipo | Descrizione |
---|---|---|
Parametro component | Tipo IRecipeComponent<T> | Descrizione The component to check for. |
Parametro contenuto | Tipo T | Descrizione The oracle that represents the element to check for. |
Parametro T | Tipo Object | Descrizione The type of the object pointed to by the component. |
Name: of
Creates a new rule that filters recipes that have the given IRecipeComponent<T> and whose value matches
the given Predicate<T> according to the given ITargetingStrategy.
Returns: A rule carrying out what has been specified
Return Type: ComponentFilteringRule<T>
ZenScript CopyComponentFilteringRule.of<T : Object>(component as IRecipeComponent<T>, content as Predicate<T>, checkStrategy as ITargetingStrategy) as ComponentFilteringRule<T>
Parametro | Tipo | Descrizione |
---|---|---|
Parametro component | Tipo IRecipeComponent<T> | Descrizione The component to check for. |
Parametro contenuto | Tipo Predicate<T> | Descrizione A Predicate<T> that determines whether an element is wanted or not. Its argument represents the object to check for. |
Parametro checkStrategy | Tipo ITargetingStrategy | Descrizione The strategy that needs to be used to compare the component's value. |
Parametro T | Tipo Object | Descrizione The type of object pointed to by the component. |
Name: of
Creates a new rule that filters recipes that have the given IRecipeComponent<T> and whose value matches the
given content
according to the given ITargetingStrategy.
Returns: A rule carrying out what has been specified.
Return Type: ComponentFilteringRule<T>
ZenScript CopyComponentFilteringRule.of<T : Object>(component as IRecipeComponent<T>, content as T, checkStrategy as ITargetingStrategy) as ComponentFilteringRule<T>
Parametro | Tipo | Descrizione |
---|---|---|
Parametro component | Tipo IRecipeComponent<T> | Descrizione The component to check for. |
Parametro contenuto | Tipo T | Descrizione The oracle that represents the element to check for. |
Parametro checkStrategy | Tipo ITargetingStrategy | Descrizione The strategy that needs to be used to compare the component's value. |
Parametro T | Tipo Object | Descrizione The type of the object pointed to by the component. |