Record Class PhysicsResult

java.lang.Object
java.lang.Record
net.minestom.server.collision.PhysicsResult

@Experimental public record PhysicsResult(Pos newPosition, Vec newVelocity, boolean isOnGround, boolean collisionX, boolean collisionY, boolean collisionZ, Vec originalDelta, @NotNull Point[] collisionPoints, @NotNull Shape[] collisionShapes, boolean hasCollision, SweepResult res) extends Record
  • Constructor Summary

    Constructors
    Constructor
    Description
    PhysicsResult(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 a PhysicsResult record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull Point[]
    Returns the value of the collisionPoints record component.
    @NotNull Shape[]
    Returns the value of the collisionShapes record component.
    boolean
    Returns the value of the collisionX record component.
    boolean
    Returns the value of the collisionY record component.
    boolean
    Returns the value of the collisionZ record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    boolean
    Returns the value of the hasCollision record component.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the isOnGround record component.
    Returns the value of the newPosition record component.
    Returns the value of the newVelocity record component.
    Returns the value of the originalDelta record component.
    res()
    Returns the value of the res record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 a PhysicsResult record class.
      Parameters:
      newPosition - the value for the newPosition record component
      newVelocity - the value for the newVelocity record component
      isOnGround - the value for the isOnGround record component
      collisionX - the value for the collisionX record component
      collisionY - the value for the collisionY record component
      collisionZ - the value for the collisionZ record component
      originalDelta - the value for the originalDelta record component
      collisionPoints - the value for the collisionPoints record component
      collisionShapes - the value for the collisionShapes record component
      hasCollision - the value for the hasCollision record component
      res - the value for the res record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • newPosition

      public Pos newPosition()
      Returns the value of the newPosition record component.
      Returns:
      the value of the newPosition record component
    • newVelocity

      public Vec newVelocity()
      Returns the value of the newVelocity record component.
      Returns:
      the value of the newVelocity record component
    • isOnGround

      public boolean isOnGround()
      Returns the value of the isOnGround record component.
      Returns:
      the value of the isOnGround record component
    • collisionX

      public boolean collisionX()
      Returns the value of the collisionX record component.
      Returns:
      the value of the collisionX record component
    • collisionY

      public boolean collisionY()
      Returns the value of the collisionY record component.
      Returns:
      the value of the collisionY record component
    • collisionZ

      public boolean collisionZ()
      Returns the value of the collisionZ record component.
      Returns:
      the value of the collisionZ record component
    • originalDelta

      public Vec originalDelta()
      Returns the value of the originalDelta record component.
      Returns:
      the value of the originalDelta record component
    • collisionPoints

      @NotNull public @NotNull Point[] collisionPoints()
      Returns the value of the collisionPoints record component.
      Returns:
      the value of the collisionPoints record component
    • collisionShapes

      @NotNull public @NotNull Shape[] collisionShapes()
      Returns the value of the collisionShapes record component.
      Returns:
      the value of the collisionShapes record component
    • hasCollision

      public boolean hasCollision()
      Returns the value of the hasCollision record component.
      Returns:
      the value of the hasCollision record component
    • res

      public SweepResult res()
      Returns the value of the res record component.
      Returns:
      the value of the res record component