Record Class Sprayed.EntityTarget
java.lang.Object
java.lang.Record
dev.jaxydog.astral.content.item.custom.Sprayed.EntityTarget
- Record Components:
target- The target entity.
- All Implemented Interfaces:
Sprayed.SprayTarget
- Enclosing interface:
Sprayed
public static record Sprayed.EntityTarget(net.minecraft.entity.Entity target)
extends Record
implements Sprayed.SprayTarget
Describes the target entity of a spray invocation.
- Since:
- 2.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionEntityTarget(net.minecraft.entity.Entity target) Creates an instance of aEntityTargetrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubledistance(Sprayed.Source source) Returns the distance of this target from the spray source.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.entity.Entitytarget()Returns the value of thetargetrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EntityTarget
public EntityTarget(net.minecraft.entity.Entity target) Creates an instance of aEntityTargetrecord class.- Parameters:
target- the value for thetargetrecord component
-
-
Method Details
-
distance
Description copied from interface:Sprayed.SprayTargetReturns the distance of this target from the spray source.- Specified by:
distancein interfaceSprayed.SprayTarget- Parameters:
source- The spray source.- Returns:
- The distance.
-
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). -
target
public net.minecraft.entity.Entity target()Returns the value of thetargetrecord component.- Returns:
- the value of the
targetrecord component
-