Record Class DistancePredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.DistancePredicate
public record DistancePredicate(MinMaxBounds.Doubles x, MinMaxBounds.Doubles y, MinMaxBounds.Doubles z, MinMaxBounds.Doubles horizontal, MinMaxBounds.Doubles absolute)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MinMaxBounds.DoublesThe field for theabsoluterecord component.static final com.mojang.serialization.Codec<DistancePredicate> private final MinMaxBounds.DoublesThe field for thehorizontalrecord component.private final MinMaxBounds.DoublesThe field for thexrecord component.private final MinMaxBounds.DoublesThe field for theyrecord component.private final MinMaxBounds.DoublesThe field for thezrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionDistancePredicate(MinMaxBounds.Doubles x, MinMaxBounds.Doubles y, MinMaxBounds.Doubles z, MinMaxBounds.Doubles horizontal, MinMaxBounds.Doubles absolute) Creates an instance of aDistancePredicaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionabsolute()Returns the value of theabsoluterecord component.static DistancePredicateabsolute(MinMaxBounds.Doubles p_148841_) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thehorizontalrecord component.static DistancePredicatehorizontal(MinMaxBounds.Doubles p_148837_) booleanmatches(double p_26256_, double p_26257_, double p_26258_, double p_26259_, double p_26260_, double p_26261_) final StringtoString()Returns a string representation of this record class.static DistancePredicatevertical(MinMaxBounds.Doubles p_148839_) x()Returns the value of thexrecord component.y()Returns the value of theyrecord component.z()Returns the value of thezrecord component.
-
Field Details
-
x
The field for thexrecord component. -
y
The field for theyrecord component. -
z
The field for thezrecord component. -
horizontal
The field for thehorizontalrecord component. -
absolute
The field for theabsoluterecord component. -
CODEC
-
-
Constructor Details
-
DistancePredicate
public DistancePredicate(MinMaxBounds.Doubles x, MinMaxBounds.Doubles y, MinMaxBounds.Doubles z, MinMaxBounds.Doubles horizontal, MinMaxBounds.Doubles absolute) Creates an instance of aDistancePredicaterecord class.- Parameters:
x- the value for thexrecord componenty- the value for theyrecord componentz- the value for thezrecord componenthorizontal- the value for thehorizontalrecord componentabsolute- the value for theabsoluterecord component
-
-
Method Details
-
horizontal
-
vertical
-
absolute
-
matches
public boolean matches(double p_26256_, double p_26257_, double p_26258_, double p_26259_, double p_26260_, double p_26261_) -
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). -
x
Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
z
Returns the value of thezrecord component.- Returns:
- the value of the
zrecord component
-
horizontal
Returns the value of thehorizontalrecord component.- Returns:
- the value of the
horizontalrecord component
-
absolute
Returns the value of theabsoluterecord component.- Returns:
- the value of the
absoluterecord component
-