Package net.minestom.server.collision
Record Class PhysicsResult
java.lang.Object
java.lang.Record
net.minestom.server.collision.PhysicsResult
-
Constructor Summary
ConstructorsConstructorDescriptionPhysicsResult(Pos newPosition, Vec newVelocity, boolean isOnGround, boolean collisionX, boolean collisionY, boolean collisionZ, Vec originalDelta, @NotNull Point[] collisionPoints, @NotNull Shape[] collisionShapes, boolean hasCollision, SweepResult res) Creates an instance of aPhysicsResultrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull Point[]Returns the value of thecollisionPointsrecord component.@NotNull Shape[]Returns the value of thecollisionShapesrecord component.booleanReturns the value of thecollisionXrecord component.booleanReturns the value of thecollisionYrecord component.booleanReturns the value of thecollisionZrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanReturns the value of thehasCollisionrecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisOnGroundrecord component.Returns the value of thenewPositionrecord component.Returns the value of thenewVelocityrecord component.Returns the value of theoriginalDeltarecord component.res()Returns the value of theresrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PhysicsResult
public PhysicsResult(Pos newPosition, Vec newVelocity, boolean isOnGround, boolean collisionX, boolean collisionY, boolean collisionZ, Vec originalDelta, @NotNull @NotNull Point[] collisionPoints, @NotNull @NotNull Shape[] collisionShapes, boolean hasCollision, SweepResult res) Creates an instance of aPhysicsResultrecord class.- Parameters:
newPosition- the value for thenewPositionrecord componentnewVelocity- the value for thenewVelocityrecord componentisOnGround- the value for theisOnGroundrecord componentcollisionX- the value for thecollisionXrecord componentcollisionY- the value for thecollisionYrecord componentcollisionZ- the value for thecollisionZrecord componentoriginalDelta- the value for theoriginalDeltarecord componentcollisionPoints- the value for thecollisionPointsrecord componentcollisionShapes- the value for thecollisionShapesrecord componenthasCollision- the value for thehasCollisionrecord componentres- the value for theresrecord 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 '=='. -
newPosition
Returns the value of thenewPositionrecord component.- Returns:
- the value of the
newPositionrecord component
-
newVelocity
Returns the value of thenewVelocityrecord component.- Returns:
- the value of the
newVelocityrecord component
-
isOnGround
public boolean isOnGround()Returns the value of theisOnGroundrecord component.- Returns:
- the value of the
isOnGroundrecord component
-
collisionX
public boolean collisionX()Returns the value of thecollisionXrecord component.- Returns:
- the value of the
collisionXrecord component
-
collisionY
public boolean collisionY()Returns the value of thecollisionYrecord component.- Returns:
- the value of the
collisionYrecord component
-
collisionZ
public boolean collisionZ()Returns the value of thecollisionZrecord component.- Returns:
- the value of the
collisionZrecord component
-
originalDelta
Returns the value of theoriginalDeltarecord component.- Returns:
- the value of the
originalDeltarecord component
-
collisionPoints
Returns the value of thecollisionPointsrecord component.- Returns:
- the value of the
collisionPointsrecord component
-
collisionShapes
Returns the value of thecollisionShapesrecord component.- Returns:
- the value of the
collisionShapesrecord component
-
hasCollision
public boolean hasCollision()Returns the value of thehasCollisionrecord component.- Returns:
- the value of the
hasCollisionrecord component
-
res
Returns the value of theresrecord component.- Returns:
- the value of the
resrecord component
-