Record Class FluidPredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.FluidPredicate
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<FluidPredicate>
The field for thefluid
record component.private final Optional<StatePropertiesPredicate>
The field for theproperties
record component.The field for thetag
record component. -
Constructor Summary
ConstructorDescriptionFluidPredicate
(Optional<TagKey<Fluid>> tag, Optional<Holder<Fluid>> fluid, Optional<StatePropertiesPredicate> properties) Creates an instance of aFluidPredicate
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.fluid()
Returns the value of thefluid
record component.final int
hashCode()
Returns a hash code value for this object.boolean
matches
(ServerLevel p_41105_, BlockPos p_41106_) Returns the value of theproperties
record component.tag()
Returns the value of thetag
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
tag
The field for thetag
record component. -
fluid
The field for thefluid
record component. -
properties
The field for theproperties
record component. -
CODEC
-
-
Constructor Details
-
FluidPredicate
public FluidPredicate(Optional<TagKey<Fluid>> tag, Optional<Holder<Fluid>> fluid, Optional<StatePropertiesPredicate> properties) Creates an instance of aFluidPredicate
record class.- Parameters:
tag
- the value for thetag
record componentfluid
- the value for thefluid
record componentproperties
- the value for theproperties
record component
-
-
Method Details
-
matches
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
tag
Returns the value of thetag
record component.- Returns:
- the value of the
tag
record component
-
fluid
Returns the value of thefluid
record component.- Returns:
- the value of the
fluid
record component
-
properties
Returns the value of theproperties
record component.- Returns:
- the value of the
properties
record component
-