Record Class BlockVec

java.lang.Object
java.lang.Record
net.minestom.server.coordinate.BlockVec
Record Components:
blockX - the block X coordinate
blockY - the block Y coordinate
blockZ - the block Z coordinate
All Implemented Interfaces:
Point

public record BlockVec(int blockX, int blockY, int blockZ) extends Record implements Point
Represents a 3D vector with block-aligned coordinates.

Using 12 bytes compared to 24 bytes for Vec. Ideal for block positions, chunk coordinates, and anything on a grid.

Conversion: When constructed from double values, coordinates are floored to the nearest integer block position.

Instances are immutable. All operations return new instances (either BlockVec for integer results or Vec where doubles are used).

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    A functional interface representing an operation on the components of a BlockVec.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final BlockVec
     
    static final BlockVec
     
    static final BlockVec
     
    static final BlockVec
     
    static final BlockVec
     

    Fields inherited from interface Point

    EPSILON, REGION_SIZE, SECTION_SIZE
  • Constructor Summary

    Constructors
    Constructor
    Description
    BlockVec(double value)
    Creates a block vector with the given value for all coordinates.
    BlockVec(double x, double y, double z)
    Narrows an assumed global coordinate to a block coordinate by flooring the value.
    BlockVec(int value)
    Creates a block vector with the given value for all coordinates (x/y/z).
    BlockVec(int blockX, int blockZ)
    Creates a BlockVec with the blockX and blockZ, with blockY being zero.
    BlockVec(int blockX, int blockY, int blockZ)
    Creates an instance of a BlockVec record class.
    BlockVec(Point point)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use Point.asBlockVec() instead
  • Method Summary

    Modifier and Type
    Method
    Description
    abs()
    Represents this point with all coordinates as their absolute values.
    add(double value)
    Creates a new point by adding the provided value to this point coordinates for all XYZ.
    add(double x, double y, double z)
    Creates a new point by adding the provided values to this point coordinates.
    add(int value)
    Adds the given integer value to all coordinates of this block vector.
    add(int blockX, int blockY, int blockZ)
    Adds the given block XYZ to this block vector.
    add(BlockVec blockVec)
    Adds the given block vector to this block vector.
    add(Point point)
    Creates a new point by adding another point coordinates to this point coordinates.
    Applies the given operator to this block vector.
    Deprecated.
    int
    Returns the value of the blockX record component.
    int
    Returns the value of the blockY record component.
    int
    Returns the value of the blockZ record component.
    cross(BlockVec point)
    Calculates the cross product of this point with another.
    cross(Point point)
    Calculates the cross product of this point with another.
    div(double value)
    Creates a new point by dividing the provided value to this point coordinates for all XYZ.
    div(double x, double y, double z)
    Creates a new point by dividing the provided values to this point coordinates.
    div(int value)
    Divides this block vector by the given integer value.
    div(int blockX, int blockY, int blockZ)
    Divides this block vector by the given integer values.
    div(BlockVec blockVec)
    Divides this block vector by another block vector.
    div(Point point)
    Creates a new point by dividing another point coordinates to this point coordinates.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    lerp(Point point, double alpha)
    Calculates a linear interpolation between this point with another point (x/y/z).
    max(double value)
    Gets a point representing the maximum values between this point and the provided value for all coordinates.
    max(double x, double y, double z)
    Gets a point representing the maximum values between this point and the provided coordinates (x/y/z).
    max(int value)
    Calculates the maximum between this block vector and the given integer value.
    max(int blockX, int blockY, int blockZ)
    Calculates the maximum between this block vector and the given block coordinates (x/y/z).
    max(BlockVec point)
    Calculates the maximum between this block vector and another block vector.
    max(Point point)
    Gets a point representing the maximum values between this point and the provided one (x/y/z).
    min(double value)
    Gets a point representing the minimum values between this point and the provided value for all coordinates.
    min(double x, double y, double z)
    Gets a point representing the minimum values between this point and the provided coordinates (x/y/z).
    min(int value)
    Calculates the minimum between this block vector and the given integer value.
    min(int blockX, int blockY, int blockZ)
    Calculates the minimum between this block vector and the given block coordinates.
    min(BlockVec point)
    Calculates the minimum between this block vector and another block vector.
    min(Point point)
    Gets a point representing the minimum values between this point and the provided one (x/y/z).
    mul(double value)
    Creates a new point by multiplying the provided value to this point coordinates for all XYZ.
    mul(double x, double y, double z)
    Creates a new point by multiplying the provided values to this point coordinates.
    mul(int value)
    Multiplies this block vector by the given integer value.
    mul(int blockX, int blockY, int blockZ)
    Multiplies this block vector by the given integer values.
    mul(BlockVec blockVec)
    Multiplies this block vector by another block vector.
    mul(Point point)
    Creates a new point by multiplying another point coordinates to this point coordinates.
    neg()
    Represents this point with all coordinates negated.
    Converts this point to a unit point (a point with length of 1).
    Creates a new point relative to this point based on the provided block face.
    boolean
    samePoint(int blockX, int blockY, int blockZ)
    Checks if two block positions have the same coordinates (x/y/z).
    boolean
    samePoint(BlockVec blockVec)
    Checks if two block vectors have the same coordinates (x/y/z).
    sub(double value)
    Creates a new point by subtracting the provided value to this point coordinates for all XYZ.
    sub(double x, double y, double z)
    Creates a new point by subtracting the provided values to this point coordinates.
    sub(int value)
    Subtracts the given integer value from all coordinates of this block vector.
    sub(int blockX, int blockY, int blockZ)
    Subtracts the given block XYZ from this block vector.
    sub(BlockVec blockVec)
    Subtracts the given block vector from this block vector.
    sub(Point point)
    Creates a new point by subtracting another point coordinates to this point coordinates.
    final String
    Returns a string representation of this record class.
    withBlockX(int blockX)
    Sets the block X coordinate to the given value.
    Applies the given operator to the block X coordinate.
    withBlockY(int blockY)
    Sets the block Y coordinate to the given value.
    Applies the given operator to the block Y coordinate.
    withBlockZ(int blockZ)
    Sets the block Z coordinate to the given value.
    Applies the given operator to the block Z coordinate.
    withX(double x)
    Creates a point with the specified X coordinate.
    Creates a point with a modified X coordinate based on its value.
    withY(double y)
    Creates a point with the specified Y coordinate.
    Creates a point with a modified Y coordinate based on its value.
    withZ(double z)
    Creates a point with the specified Z coordinate.
    Creates a point with a modified Z coordinate based on its value.
    double
    x()
    Gets the X coordinate.
    double
    y()
    Gets the Y coordinate.
    double
    z()
    Gets the Z coordinate.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • ZERO

      public static final BlockVec ZERO
    • ONE

      public static final BlockVec ONE
    • SECTION

      public static final BlockVec SECTION
    • CHUNK

      public static final BlockVec CHUNK
    • REGION

      public static final BlockVec REGION
  • Constructor Details

    • BlockVec

      public BlockVec(double x, double y, double z)
      Narrows an assumed global coordinate to a block coordinate by flooring the value.
      Developer Note: Minestom should not call this constructor without explicit warnings.
      Parameters:
      x - the global x coordinate
      y - the global y coordinate
      z - the global z coordinate
    • BlockVec

      public BlockVec(double value)
      Creates a block vector with the given value for all coordinates. See BlockVec(double, double, double) for side effects.
      Parameters:
      value - the value
    • BlockVec

      @Deprecated(forRemoval=true) public BlockVec(Point point)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use Point.asBlockVec() instead
      Creates a block vector from a point.
      Parameters:
      point - the point
    • BlockVec

      public BlockVec(int blockX, int blockZ)
      Creates a BlockVec with the blockX and blockZ, with blockY being zero.
      Parameters:
      blockX - the blockX
      blockZ - the blockZ
    • BlockVec

      public BlockVec(int value)
      Creates a block vector with the given value for all coordinates (x/y/z).
      Parameters:
      value - the value
    • BlockVec

      public BlockVec(int blockX, int blockY, int blockZ)
      Creates an instance of a BlockVec record class.
      Parameters:
      blockX - the value for the blockX record component
      blockY - the value for the blockY record component
      blockZ - the value for the blockZ record component
  • Method Details

    • x

      @Contract(pure=true) public double x()
      Description copied from interface: Point
      Gets the X coordinate.
      Specified by:
      x in interface Point
      Returns:
      the X coordinate
    • y

      @Contract(pure=true) public double y()
      Description copied from interface: Point
      Gets the Y coordinate.
      Specified by:
      y in interface Point
      Returns:
      the Y coordinate
    • z

      @Contract(pure=true) public double z()
      Description copied from interface: Point
      Gets the Z coordinate.
      Specified by:
      z in interface Point
      Returns:
      the Z coordinate
    • apply

      public BlockVec apply(BlockVec.Operator operator)
      Applies the given operator to this block vector.
      Parameters:
      operator - the operator to apply
      Returns:
      the resulting block vector
    • withX

      @Contract("_ -> new") public Vec withX(DoubleUnaryOperator operator)
      Description copied from interface: Point
      Creates a point with a modified X coordinate based on its value.
      Specified by:
      withX in interface Point
      Parameters:
      operator - the operator providing the current X coordinate and returning the new
      Returns:
      a new point
    • withX

      @Contract(pure=true, value="_ -> new") public Vec withX(double x)
      Description copied from interface: Point
      Creates a point with the specified X coordinate.
      Specified by:
      withX in interface Point
      Parameters:
      x - the new X coordinate
      Returns:
      a new point
    • withBlockX

      @Contract(pure=true, value="_ -> new") public BlockVec withBlockX(int blockX)
      Sets the block X coordinate to the given value.
      Parameters:
      blockX - the block X coordinate
      Returns:
      the resulting block vector
    • withBlockX

      @Contract("_ -> new") public BlockVec withBlockX(IntUnaryOperator operator)
      Applies the given operator to the block X coordinate.
      Parameters:
      operator - the operator to apply
      Returns:
      the resulting block vector
    • withY

      @Contract("_ -> new") public Vec withY(DoubleUnaryOperator operator)
      Description copied from interface: Point
      Creates a point with a modified Y coordinate based on its value.
      Specified by:
      withY in interface Point
      Parameters:
      operator - the operator providing the current Y coordinate and returning the new
      Returns:
      a new point
    • withY

      @Contract(pure=true, value="_ -> new") public Vec withY(double y)
      Description copied from interface: Point
      Creates a point with the specified Y coordinate.
      Specified by:
      withY in interface Point
      Parameters:
      y - the new Y coordinate
      Returns:
      a new point
    • withBlockY

      @Contract(pure=true, value="_ -> new") public BlockVec withBlockY(int blockY)
      Sets the block Y coordinate to the given value.
      Parameters:
      blockY - the block Y coordinate
      Returns:
      the resulting block vector
    • withBlockY

      @Contract("_ -> new") public BlockVec withBlockY(IntUnaryOperator operator)
      Applies the given operator to the block Y coordinate.
      Parameters:
      operator - the operator to apply
      Returns:
      the resulting block vector
    • withZ

      @Contract("_ -> new") public Vec withZ(DoubleUnaryOperator operator)
      Description copied from interface: Point
      Creates a point with a modified Z coordinate based on its value.
      Specified by:
      withZ in interface Point
      Parameters:
      operator - the operator providing the current Z coordinate and returning the new
      Returns:
      a new point
    • withZ

      @Contract(pure=true, value="_ -> new") public Vec withZ(double z)
      Description copied from interface: Point
      Creates a point with the specified Z coordinate.
      Specified by:
      withZ in interface Point
      Parameters:
      z - the new Z coordinate
      Returns:
      a new point
    • withBlockZ

      @Contract(pure=true, value="_ -> new") public BlockVec withBlockZ(int blockZ)
      Sets the block Z coordinate to the given value.
      Parameters:
      blockZ - the block Z coordinate
      Returns:
      the resulting block vector
    • withBlockZ

      @Contract("_ -> new") public BlockVec withBlockZ(IntUnaryOperator operator)
      Applies the given operator to the block Z coordinate.
      Parameters:
      operator - the operator to apply
      Returns:
      the resulting block vector
    • add

      @Contract(pure=true, value="_, _, _ -> new") public Vec add(double x, double y, double z)
      Description copied from interface: Point
      Creates a new point by adding the provided values to this point coordinates.
      Specified by:
      add in interface Point
      Parameters:
      x - the x to add
      y - the y to add
      z - the z to add
      Returns:
      the new point
    • add

      @Contract(pure=true, value="_, _, _ -> new") public BlockVec add(int blockX, int blockY, int blockZ)
      Adds the given block XYZ to this block vector.
      Parameters:
      blockX - the block X to add
      blockY - the block Y to add
      blockZ - the block Z to add
      Returns:
      the resulting block vector
    • add

      @Contract(pure=true, value="_ -> new") public Vec add(Point point)
      Description copied from interface: Point
      Creates a new point by adding another point coordinates to this point coordinates.
      Specified by:
      add in interface Point
      Parameters:
      point - the point decomposed by Point.x(), Point.y() and Point.z()
      Returns:
      the new point
    • add

      @Contract(pure=true, value="_ -> new") public BlockVec add(BlockVec blockVec)
      Adds the given block vector to this block vector.
      Parameters:
      blockVec - the block vector to add
      Returns:
      the resulting block vector
    • add

      @Contract(pure=true, value="_ -> new") public Vec add(double value)
      Description copied from interface: Point
      Creates a new point by adding the provided value to this point coordinates for all XYZ.
      Specified by:
      add in interface Point
      Parameters:
      value - the value to add
      Returns:
      the new point
    • add

      @Contract(pure=true, value="_ -> new") public BlockVec add(int value)
      Adds the given integer value to all coordinates of this block vector.
      Parameters:
      value - the value to add
      Returns:
      the resulting block vector
    • sub

      @Contract(pure=true, value="_, _, _ -> new") public Vec sub(double x, double y, double z)
      Description copied from interface: Point
      Creates a new point by subtracting the provided values to this point coordinates.
      Specified by:
      sub in interface Point
      Parameters:
      x - the x to subtract
      y - the y to subtract
      z - the z to subtract
      Returns:
      the new point
    • sub

      @Contract(pure=true, value="_, _, _ -> new") public BlockVec sub(int blockX, int blockY, int blockZ)
      Subtracts the given block XYZ from this block vector.
      Parameters:
      blockX - the block X to subtract
      blockY - the block Y to subtract
      blockZ - the block Z to subtract
      Returns:
      the resulting block vector
    • sub

      @Contract(pure=true, value="_ -> new") public Vec sub(Point point)
      Description copied from interface: Point
      Creates a new point by subtracting another point coordinates to this point coordinates.
      Specified by:
      sub in interface Point
      Parameters:
      point - the point decomposed by Point.x(), Point.y() and Point.z()
      Returns:
      the new point
    • sub

      @Contract(pure=true, value="_ -> new") public BlockVec sub(BlockVec blockVec)
      Subtracts the given block vector from this block vector.
      Parameters:
      blockVec - the block vector to subtract
      Returns:
      the resulting block vector
    • sub

      @Contract(pure=true, value="_ -> new") public Vec sub(double value)
      Description copied from interface: Point
      Creates a new point by subtracting the provided value to this point coordinates for all XYZ.
      Specified by:
      sub in interface Point
      Parameters:
      value - the value to subtract
      Returns:
      the new point
    • sub

      @Contract(pure=true, value="_ -> new") public BlockVec sub(int value)
      Subtracts the given integer value from all coordinates of this block vector.
      Parameters:
      value - the value to subtract
      Returns:
      the resulting block vector
    • mul

      @Contract(pure=true, value="_, _, _ -> new") public Vec mul(double x, double y, double z)
      Description copied from interface: Point
      Creates a new point by multiplying the provided values to this point coordinates.
      Specified by:
      mul in interface Point
      Parameters:
      x - the x to multiply
      y - the y to multiply
      z - the z to multiply
      Returns:
      the new point
    • mul

      @Contract(pure=true, value="_, _, _ -> new") public BlockVec mul(int blockX, int blockY, int blockZ)
      Multiplies this block vector by the given integer values.
      Parameters:
      blockX - the block x to multiply by
      blockY - the block y to multiply by
      blockZ - the block z to multiply by
      Returns:
      the resulting block vector
    • mul

      @Contract(pure=true, value="_ -> new") public Vec mul(Point point)
      Description copied from interface: Point
      Creates a new point by multiplying another point coordinates to this point coordinates.
      Specified by:
      mul in interface Point
      Parameters:
      point - the point decomposed by Point.x(), Point.y() and Point.z()
      Returns:
      the new point
    • mul

      @Contract(pure=true, value="_ -> new") public BlockVec mul(BlockVec blockVec)
      Multiplies this block vector by another block vector.
      Parameters:
      blockVec - the block vector to multiply by
      Returns:
      the resulting block vector
    • mul

      @Contract(pure=true, value="_ -> new") public Vec mul(double value)
      Description copied from interface: Point
      Creates a new point by multiplying the provided value to this point coordinates for all XYZ.
      Specified by:
      mul in interface Point
      Parameters:
      value - the value to multiply
      Returns:
      the new point
    • mul

      @Contract(pure=true, value="_ -> new") public BlockVec mul(int value)
      Multiplies this block vector by the given integer value.
      Parameters:
      value - the value to multiply by
      Returns:
      the resulting block vector
    • div

      @Contract(pure=true, value="_, _, _ -> new") public Vec div(double x, double y, double z)
      Description copied from interface: Point
      Creates a new point by dividing the provided values to this point coordinates.

      Warning: division by zero will not error.

      Specified by:
      div in interface Point
      Parameters:
      x - the x to divide
      y - the y to divide
      z - the z to divide
      Returns:
      the new point
    • div

      @Contract(pure=true, value="_, _, _ -> new") public BlockVec div(int blockX, int blockY, int blockZ)
      Divides this block vector by the given integer values.
      Parameters:
      blockX - the x divisor
      blockY - the y divisor
      blockZ - the z divisor
      Returns:
      the resulting block vector
      Throws:
      ArithmeticException - if any of the divisors is zero
    • div

      @Contract(pure=true, value="_ -> new") public Vec div(Point point)
      Description copied from interface: Point
      Creates a new point by dividing another point coordinates to this point coordinates.

      Warning: division by zero will not error.

      Specified by:
      div in interface Point
      Parameters:
      point - the point decomposed by Point.x(), Point.y() and Point.z()
      Returns:
      the new point
    • div

      @Contract(pure=true, value="_ -> new") public BlockVec div(BlockVec blockVec)
      Divides this block vector by another block vector.
      Parameters:
      blockVec - the block vector divisor
      Returns:
      the resulting block vector
      Throws:
      ArithmeticException - if any component of the divisor is zero
    • div

      @Contract(pure=true, value="_ -> new") public Vec div(double value)
      Description copied from interface: Point
      Creates a new point by dividing the provided value to this point coordinates for all XYZ.

      Warning: division by zero will not error.

      Specified by:
      div in interface Point
      Parameters:
      value - the value to divide
      Returns:
      the new point
    • div

      @Contract(pure=true, value="_ -> new") public BlockVec div(int value)
      Divides this block vector by the given integer value.
      Parameters:
      value - the divisor
      Returns:
      the resulting block vector
      Throws:
      ArithmeticException - if the divisor is zero
    • relative

      @Contract(pure=true, value="_ -> new") public BlockVec relative(BlockFace face)
      Description copied from interface: Point
      Creates a new point relative to this point based on the provided block face.
      Specified by:
      relative in interface Point
      Parameters:
      face - the face
      Returns:
      the new point
    • neg

      @Contract(pure=true, value="-> new") public BlockVec neg()
      Description copied from interface: Point
      Represents this point with all coordinates negated. For example, (x, y, z) becomes (-x, -y, -z).
      Specified by:
      neg in interface Point
      Returns:
      the negated point
    • abs

      @Contract(pure=true, value="-> new") public BlockVec abs()
      Description copied from interface: Point
      Represents this point with all coordinates as their absolute values. For example, (x, y, z) becomes (|x|, |y|, |z|).
      Specified by:
      abs in interface Point
      Returns:
      the absolute point
    • min

      @Contract(pure=true, value="_ -> new") public Vec min(Point point)
      Description copied from interface: Point
      Gets a point representing the minimum values between this point and the provided one (x/y/z).
      Specified by:
      min in interface Point
      Parameters:
      point - the other point
      Returns:
      the minimum point
    • min

      @Contract(pure=true, value="_, _, _ -> new") public Vec min(double x, double y, double z)
      Description copied from interface: Point
      Gets a point representing the minimum values between this point and the provided coordinates (x/y/z).
      Specified by:
      min in interface Point
      Parameters:
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
      Returns:
      the minimum point
    • min

      @Contract(pure=true, value="_ -> new") public Vec min(double value)
      Description copied from interface: Point
      Gets a point representing the minimum values between this point and the provided value for all coordinates.
      Specified by:
      min in interface Point
      Parameters:
      value - the value
      Returns:
      the minimum point
    • min

      @Contract(pure=true, value="_ -> new") public BlockVec min(BlockVec point)
      Calculates the minimum between this block vector and another block vector.
      Parameters:
      point - the other block vector
      Returns:
      the resulting block vector
    • min

      @Contract(pure=true, value="_, _, _ -> new") public BlockVec min(int blockX, int blockY, int blockZ)
      Calculates the minimum between this block vector and the given block coordinates.
      Parameters:
      blockX - the blockX
      blockY - the blockY
      blockZ - the blockZ
      Returns:
      the resulting block vector
    • min

      @Contract(pure=true, value="_ -> new") public BlockVec min(int value)
      Calculates the minimum between this block vector and the given integer value.
      Parameters:
      value - the value
      Returns:
      the resulting block vector
    • max

      @Contract(pure=true, value="_ -> new") public Vec max(Point point)
      Description copied from interface: Point
      Gets a point representing the maximum values between this point and the provided one (x/y/z).
      Specified by:
      max in interface Point
      Parameters:
      point - the other point
      Returns:
      the maximum point
    • max

      @Contract(pure=true, value="_, _, _ -> new") public Vec max(double x, double y, double z)
      Description copied from interface: Point
      Gets a point representing the maximum values between this point and the provided coordinates (x/y/z).
      Specified by:
      max in interface Point
      Parameters:
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
      Returns:
      the maximum point
    • max

      @Contract(pure=true, value="_ -> new") public Vec max(double value)
      Description copied from interface: Point
      Gets a point representing the maximum values between this point and the provided value for all coordinates.
      Specified by:
      max in interface Point
      Parameters:
      value - the value
      Returns:
      the maximum point
    • normalize

      @Contract(pure=true, value="-> new") public Vec normalize()
      Description copied from interface: Point
      Converts this point to a unit point (a point with length of 1).
      Specified by:
      normalize in interface Point
      Returns:
      the same point
    • cross

      @Contract(pure=true, value="_ -> new") public Vec cross(Point point)
      Description copied from interface: Point
      Calculates the cross product of this point with another. The cross product is defined as:
      • x = y1 * z2 - y2 * z1
      • y = z1 * x2 - z2 * x1
      • z = x1 * y2 - x2 * y1
      Specified by:
      cross in interface Point
      Parameters:
      point - the other point
      Returns:
      the cross product point
    • cross

      @Contract(pure=true, value="_ -> new") public BlockVec cross(BlockVec point)
      Calculates the cross product of this point with another. The cross product is defined as:
      • x = y1 * z2 - y2 * z1
      • y = z1 * x2 - z2 * x1
      • z = x1 * y2 - x2 * y1
      Parameters:
      point - the other point
      Returns:
      the cross product point
    • lerp

      @Contract(pure=true, value="_, _ -> new") public Vec lerp(Point point, double alpha)
      Description copied from interface: Point
      Calculates a linear interpolation between this point with another point (x/y/z).
      Specified by:
      lerp in interface Point
      Parameters:
      point - the other point
      alpha - The alpha value, must be between 0.0 and 1.0
      Returns:
      Linear interpolated point
    • max

      @Contract(pure=true, value="_ -> new") public BlockVec max(BlockVec point)
      Calculates the maximum between this block vector and another block vector.
      Parameters:
      point - the other block vector
      Returns:
      the resulting block vector
    • max

      @Contract(pure=true, value="_, _, _ -> new") public BlockVec max(int blockX, int blockY, int blockZ)
      Calculates the maximum between this block vector and the given block coordinates (x/y/z).
      Parameters:
      blockX - the block X
      blockY - the block Y
      blockZ - the block Z
      Returns:
      the resulting block vector
    • max

      @Contract(pure=true, value="_ -> new") public BlockVec max(int value)
      Calculates the maximum between this block vector and the given integer value.
      Parameters:
      value - the value
      Returns:
      the resulting block vector
    • samePoint

      @Contract(pure=true) public boolean samePoint(int blockX, int blockY, int blockZ)
      Checks if two block positions have the same coordinates (x/y/z).
      Parameters:
      blockX - the block X coordinate
      blockY - the block Y coordinate
      blockZ - the block Z coordinate
      Returns:
      true if the coordinates are the same
    • samePoint

      @Contract(pure=true) public boolean samePoint(BlockVec blockVec)
      Checks if two block vectors have the same coordinates (x/y/z).
      Parameters:
      blockVec - the other block vector
      Returns:
      true if the coordinates are the same
    • asBlockVec

      @Deprecated @Contract(pure=true, value="-> this") public BlockVec asBlockVec()
      Deprecated.
      Does nothing as this is already a BlockVec.

      Marked as deprecated to warn against redundant usage.

      Specified by:
      asBlockVec in interface Point
      Returns:
      this block vector
    • 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.
    • blockX

      public int blockX()
      Returns the value of the blockX record component.
      Specified by:
      blockX in interface Point
      Returns:
      the value of the blockX record component
    • blockY

      public int blockY()
      Returns the value of the blockY record component.
      Specified by:
      blockY in interface Point
      Returns:
      the value of the blockY record component
    • blockZ

      public int blockZ()
      Returns the value of the blockZ record component.
      Specified by:
      blockZ in interface Point
      Returns:
      the value of the blockZ record component