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.Doubles
The field for theabsolute
record component.static final com.mojang.serialization.Codec
<DistancePredicate> private final MinMaxBounds.Doubles
The field for thehorizontal
record component.private final MinMaxBounds.Doubles
The field for thex
record component.private final MinMaxBounds.Doubles
The field for they
record component.private final MinMaxBounds.Doubles
The field for thez
record component. -
Constructor Summary
ConstructorsConstructorDescriptionDistancePredicate
(MinMaxBounds.Doubles x, MinMaxBounds.Doubles y, MinMaxBounds.Doubles z, MinMaxBounds.Doubles horizontal, MinMaxBounds.Doubles absolute) Creates an instance of aDistancePredicate
record class. -
Method Summary
Modifier and TypeMethodDescriptionabsolute()
Returns the value of theabsolute
record component.static DistancePredicate
absolute
(MinMaxBounds.Doubles absolute) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of thehorizontal
record component.static DistancePredicate
horizontal
(MinMaxBounds.Doubles horizontal) boolean
matches
(double x1, double y1, double z1, double x2, double y2, double z2) final String
toString()
Returns a string representation of this record class.static DistancePredicate
vertical
(MinMaxBounds.Doubles vertical) x()
Returns the value of thex
record component.y()
Returns the value of they
record component.z()
Returns the value of thez
record component.
-
Field Details
-
x
The field for thex
record component. -
y
The field for they
record component. -
z
The field for thez
record component. -
horizontal
The field for thehorizontal
record component. -
absolute
The field for theabsolute
record 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 aDistancePredicate
record class.- Parameters:
x
- the value for thex
record componenty
- the value for they
record componentz
- the value for thez
record componenthorizontal
- the value for thehorizontal
record componentabsolute
- the value for theabsolute
record component
-
-
Method Details
-
horizontal
-
vertical
-
absolute
-
matches
public boolean matches(double x1, double y1, double z1, double x2, double y2, double z2) -
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 thex
record component.- Returns:
- the value of the
x
record component
-
y
Returns the value of they
record component.- Returns:
- the value of the
y
record component
-
z
Returns the value of thez
record component.- Returns:
- the value of the
z
record component
-
horizontal
Returns the value of thehorizontal
record component.- Returns:
- the value of the
horizontal
record component
-
absolute
Returns the value of theabsolute
record component.- Returns:
- the value of the
absolute
record component
-