Record Class EntityCollisionResult
java.lang.Object
java.lang.Record
net.minestom.server.collision.EntityCollisionResult
- Record Components:
collisionPoint-entity-direction- the direction of the collision. ex. Vec(-1, 0, 0) means the entity collided with the west face of the entity
- All Implemented Interfaces:
Comparable<EntityCollisionResult>
public record EntityCollisionResult(Point collisionPoint, Entity entity, Vec direction, double percentage)
extends Record
implements Comparable<EntityCollisionResult>
Represents the result of a collision with an entity
-
Constructor Summary
ConstructorsConstructorDescriptionEntityCollisionResult(Point collisionPoint, Entity entity, Vec direction, double percentage) Creates an instance of aEntityCollisionResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecollisionPointrecord component.intReturns the value of thedirectionrecord component.entity()Returns the value of theentityrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleReturns the value of thepercentagerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EntityCollisionResult
Creates an instance of aEntityCollisionResultrecord class.- Parameters:
collisionPoint- the value for thecollisionPointrecord componententity- the value for theentityrecord componentdirection- the value for thedirectionrecord componentpercentage- the value for thepercentagerecord component
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<EntityCollisionResult>
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
collisionPoint
Returns the value of thecollisionPointrecord component.- Returns:
- the value of the
collisionPointrecord component
-
entity
-
direction
-
percentage
public double percentage()Returns the value of thepercentagerecord component.- Returns:
- the value of the
percentagerecord component
-