Package net.minestom.server.collision
Record Class PhysicsResult
java.lang.Object
java.lang.Record
net.minestom.server.collision.PhysicsResult
-
Constructor Summary
ConstructorDescriptionPhysicsResult
(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 aPhysicsResult
record class. -
Method Summary
Modifier and TypeMethodDescription@NotNull Point[]
Returns the value of thecollisionPoints
record component.@NotNull Shape[]
Returns the value of thecollisionShapes
record component.boolean
Returns the value of thecollisionX
record component.boolean
Returns the value of thecollisionY
record component.boolean
Returns the value of thecollisionZ
record component.final boolean
Indicates whether some other object is "equal to" this one.boolean
Returns the value of thehasCollision
record component.final int
hashCode()
Returns a hash code value for this object.boolean
Returns the value of theisOnGround
record component.Returns the value of thenewPosition
record component.Returns the value of thenewVelocity
record component.Returns the value of theoriginalDelta
record component.res()
Returns the value of theres
record component.final String
toString()
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 aPhysicsResult
record class.- Parameters:
newPosition
- the value for thenewPosition
record componentnewVelocity
- the value for thenewVelocity
record componentisOnGround
- the value for theisOnGround
record componentcollisionX
- the value for thecollisionX
record componentcollisionY
- the value for thecollisionY
record componentcollisionZ
- the value for thecollisionZ
record componentoriginalDelta
- the value for theoriginalDelta
record componentcollisionPoints
- the value for thecollisionPoints
record componentcollisionShapes
- the value for thecollisionShapes
record componenthasCollision
- the value for thehasCollision
record componentres
- the value for theres
record 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 thenewPosition
record component.- Returns:
- the value of the
newPosition
record component
-
newVelocity
Returns the value of thenewVelocity
record component.- Returns:
- the value of the
newVelocity
record component
-
isOnGround
public boolean isOnGround()Returns the value of theisOnGround
record component.- Returns:
- the value of the
isOnGround
record component
-
collisionX
public boolean collisionX()Returns the value of thecollisionX
record component.- Returns:
- the value of the
collisionX
record component
-
collisionY
public boolean collisionY()Returns the value of thecollisionY
record component.- Returns:
- the value of the
collisionY
record component
-
collisionZ
public boolean collisionZ()Returns the value of thecollisionZ
record component.- Returns:
- the value of the
collisionZ
record component
-
originalDelta
Returns the value of theoriginalDelta
record component.- Returns:
- the value of the
originalDelta
record component
-
collisionPoints
Returns the value of thecollisionPoints
record component.- Returns:
- the value of the
collisionPoints
record component
-
collisionShapes
Returns the value of thecollisionShapes
record component.- Returns:
- the value of the
collisionShapes
record component
-
hasCollision
public boolean hasCollision()Returns the value of thehasCollision
record component.- Returns:
- the value of the
hasCollision
record component
-
res
Returns the value of theres
record component.- Returns:
- the value of the
res
record component
-