Record Class LocalizedCollisionBox

java.lang.Object
java.lang.Record
com.zenith.mc.block.LocalizedCollisionBox

public record LocalizedCollisionBox(double minX, double maxX, double minY, double maxY, double minZ, double maxZ, double x, double y, double z) extends Record
CollisionBox localized to coordinates
  • Constructor Details

    • LocalizedCollisionBox

      public LocalizedCollisionBox(CollisionBox cb, double x, double y, double z)
    • LocalizedCollisionBox

      public LocalizedCollisionBox(double minX, double maxX, double minY, double maxY, double minZ, double maxZ, double x, double y, double z)
      Creates an instance of a LocalizedCollisionBox record class.
      Parameters:
      minX - the value for the minX record component
      maxX - the value for the maxX record component
      minY - the value for the minY record component
      maxY - the value for the maxY record component
      minZ - the value for the minZ record component
      maxZ - the value for the maxZ record component
      x - the value for the x record component
      y - the value for the y record component
      z - the value for the z record component
  • Method Details

    • stretch

      public LocalizedCollisionBox stretch(double x, double y, double z)
    • inflate

      public LocalizedCollisionBox inflate(double x, double y, double z)
    • move

      public LocalizedCollisionBox move(double x, double y, double z)
    • minmax

    • intersect

      public LocalizedCollisionBox intersect(LocalizedCollisionBox other)
    • intersectsStrict

      public boolean intersectsStrict(LocalizedCollisionBox other)
      Excludes boxes that are only touching, like vanilla's AABB.intersects
    • collideX

      public double collideX(LocalizedCollisionBox other, double x)
    • collideY

      public double collideY(LocalizedCollisionBox other, double y)
    • collideZ

      public double collideZ(LocalizedCollisionBox other, double z)
    • collidePushOut

      public static double collidePushOut(double box1Min, double box1Max, double box2Min, double box2Max, double speed)
    • noXIntersection

      public boolean noXIntersection(LocalizedCollisionBox other)
    • noYIntersection

      public boolean noYIntersection(LocalizedCollisionBox other)
    • noZIntersection

      public boolean noZIntersection(LocalizedCollisionBox other)
    • intersects

      public boolean intersects(LocalizedCollisionBox other)
    • intersects

      public boolean intersects(double oMinX, double oMaxX, double oMinY, double oMaxY, double oMinZ, double oMaxZ)
    • rayIntersection

      public @Nullable RayIntersection rayIntersection(double x1, double y1, double z1, double x2, double y2, double z2)
    • centerX

      public double centerX()
    • centerY

      public double centerY()
    • centerZ

      public double centerZ()
    • 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. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      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.
    • minX

      public double minX()
      Returns the value of the minX record component.
      Returns:
      the value of the minX record component
    • maxX

      public double maxX()
      Returns the value of the maxX record component.
      Returns:
      the value of the maxX record component
    • minY

      public double minY()
      Returns the value of the minY record component.
      Returns:
      the value of the minY record component
    • maxY

      public double maxY()
      Returns the value of the maxY record component.
      Returns:
      the value of the maxY record component
    • minZ

      public double minZ()
      Returns the value of the minZ record component.
      Returns:
      the value of the minZ record component
    • maxZ

      public double maxZ()
      Returns the value of the maxZ record component.
      Returns:
      the value of the maxZ record component
    • x

      public double x()
      Returns the value of the x record component.
      Returns:
      the value of the x record component
    • y

      public double y()
      Returns the value of the y record component.
      Returns:
      the value of the y record component
    • z

      public double z()
      Returns the value of the z record component.
      Returns:
      the value of the z record component