FluidPredicate
Link to fluidpredicate
Represents a predicate for a MCFluid.
This predicate will match a fluid state with either the given MCFluid or fluid tag (MCTag<T>), with the second check taking precedence over the first if they are both present. If this comparison succeeds, then the predicate may also verify additional fluid state properties via the supplied StatePropertiesPredicate.
By default, this predicate allows any fluid state to pass the checks without restrictions.
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.predicate.FluidPredicate;
Extending AnyDefaultingVanillaWrappingPredicate
Link to extending-anydefaultingvanillawrappingpredicate
FluidPredicate extends AnyDefaultingVanillaWrappingPredicate. That means all methods available in AnyDefaultingVanillaWrappingPredicate are also available in FluidPredicate
Methods
Link to methods
Name: withFluid
Sets the fluid that this predicate should match.
If a tag to match against has already been set, then the tag check will take precedence over this check.
Returns: This predicate for chaining.
Return Type: FluidPredicate
ZenScript CopyFluidPredicate.withFluid(fluid as MCFluid) as FluidPredicate
Parameter | Type | Description |
---|---|---|
Parameter fluid | Type MCFluid | Description The fluid the predicate should match. |
Name: withFluidTag
Sets the tag that this predicate should use for matching.
The predicate will successfully match only if the supplied fluid state's fluid is contained within the given tag.
Specifying both a tag and a fluid to match against will make the tag take precedence over the fluid.
Returns: This predicate for chaining.
Return Type: FluidPredicate
ZenScript CopyFluidPredicate.withFluidTag(fluidTag as MCTag<MCFluid>) as FluidPredicate
Parameter | Type | Description |
---|---|---|
Parameter fluidTag | Type MCTag<MCFluid> | Description The tag the predicate should use for matching. |
Name: withStatePropertiesPredicate
Creates and sets the StatePropertiesPredicate that will be matched against the fluid state's properties.
Any changes that have already been made to the state properties predicate will be overwritten, effectively replacing the previous one, if any.
Returns: This predicate for chaining.
Return Type: FluidPredicate
ZenScript CopyFluidPredicate.withStatePropertiesPredicate(builder as Consumer<StatePropertiesPredicate>) as FluidPredicate
Parameter | Type | Description |
---|---|---|
Parameter builder | Type Consumer<StatePropertiesPredicate> | Description A consumer that will be used to configure the StatePropertiesPredicate. |