Package net.minecraftforge.network
Record Class PacketDistributor.TargetPoint
java.lang.Object
java.lang.Record
net.minecraftforge.network.PacketDistributor.TargetPoint
- Enclosing class:
PacketDistributor<T>
public static record PacketDistributor.TargetPoint(@Nullable ServerPlayer excluded, double x, double y, double z, double r2, ResourceKey<Level> dim)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ResourceKey<Level> The field for thedimrecord component.private final @Nullable ServerPlayerThe field for theexcludedrecord component.private final doubleThe field for ther2record component.private final doubleThe field for thexrecord component.private final doubleThe field for theyrecord component.private final doubleThe field for thezrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionTargetPoint(double x, double y, double z, double r2, ResourceKey<Level> dim) A target point without excluded entityTargetPoint(@Nullable ServerPlayer excluded, double x, double y, double z, double r2, ResourceKey<Level> dim) Creates an instance of aTargetPointrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondim()Returns the value of thedimrecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable ServerPlayerexcluded()Returns the value of theexcludedrecord component.final inthashCode()Returns a hash code value for this object.doubler2()Returns the value of ther2record component.final StringtoString()Returns a string representation of this record class.doublex()Returns the value of thexrecord component.doubley()Returns the value of theyrecord component.doublez()Returns the value of thezrecord component.
-
Field Details
-
excluded
The field for theexcludedrecord component. -
x
private final double xThe field for thexrecord component. -
y
private final double yThe field for theyrecord component. -
z
private final double zThe field for thezrecord component. -
r2
private final double r2The field for ther2record component. -
dim
The field for thedimrecord component.
-
-
Constructor Details
-
TargetPoint
A target point without excluded entity -
TargetPoint
public TargetPoint(@Nullable @Nullable ServerPlayer excluded, double x, double y, double z, double r2, ResourceKey<Level> dim) Creates an instance of aTargetPointrecord class.- Parameters:
excluded- the value for theexcludedrecord componentx- the value for thexrecord componenty- the value for theyrecord componentz- the value for thezrecord componentr2- the value for ther2record componentdim- the value for thedimrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
excluded
Returns the value of theexcludedrecord component.- Returns:
- the value of the
excludedrecord component
-
x
public double x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
public double y()Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
z
public double z()Returns the value of thezrecord component.- Returns:
- the value of the
zrecord component
-
r2
public double r2()Returns the value of ther2record component.- Returns:
- the value of the
r2record component
-
dim
Returns the value of thedimrecord component.- Returns:
- the value of the
dimrecord component
-