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
Modifier 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
ConstructorDescriptionDistancePredicate
(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 p_148841_) final boolean
Indicates whether some other object is "equal to" this one.static Optional<DistancePredicate>
fromJson
(com.google.gson.JsonElement p_26265_) final int
hashCode()
Returns a hash code value for this object.Returns the value of thehorizontal
record component.static DistancePredicate
horizontal
(MinMaxBounds.Doubles p_148837_) boolean
matches
(double p_26256_, double p_26257_, double p_26258_, double p_26259_, double p_26260_, double p_26261_) com.google.gson.JsonElement
final String
toString()
Returns a string representation of this record class.static DistancePredicate
vertical
(MinMaxBounds.Doubles p_148839_) 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 p_26256_, double p_26257_, double p_26258_, double p_26259_, double p_26260_, double p_26261_) -
fromJson
-
serializeToJson
public com.google.gson.JsonElement serializeToJson() -
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
-