Interface BlockPosition

All Superinterfaces:
Position

public sealed interface BlockPosition extends Position
A position made of integer coordinates, pointing at a single block.
Since:
0.1.0
See Also:
  • Method Details

    • relative

      @Contract(value="_, _ -> new", pure=true) BlockPosition relative(BlockFace face, int distance)
      Description copied from interface: Position
      Moves this position by the defined distance in the direction of the given face.
      Specified by:
      relative in interface Position
      Parameters:
      face - the direction to move towards
      distance - the offset distance
      Returns:
      a new position moved by one block towards the given face
    • relative

      @Contract(value="_ -> new", pure=true) BlockPosition relative(BlockFace face)
      Description copied from interface: Position
      Moves this position by one block in the direction of the given face.
      Specified by:
      relative in interface Position
      Parameters:
      face - the direction to move towards
      Returns:
      a new position moved by one block towards the given face
      See Also:
    • offsetX

      @Contract(value="_ -> new", pure=true) BlockPosition offsetX(int x)
      Description copied from interface: Position
      Moves this position along the X axis by a whole number of blocks.
      Specified by:
      offsetX in interface Position
      Parameters:
      x - the amount to add to the X coordinate
      Returns:
      a new position of the same kind with the given amount added to the X coordinate
    • offsetY

      @Contract(value="_ -> new", pure=true) BlockPosition offsetY(int y)
      Description copied from interface: Position
      Moves this position along the Y axis by a whole number of blocks.
      Specified by:
      offsetY in interface Position
      Parameters:
      y - the amount to add to the Y coordinate
      Returns:
      a new position of the same kind with the given amount added to the Y coordinate
    • offsetZ

      @Contract(value="_ -> new", pure=true) BlockPosition offsetZ(int z)
      Description copied from interface: Position
      Moves this position along the Z axis by a whole number of blocks.
      Specified by:
      offsetZ in interface Position
      Parameters:
      z - the amount to add to the Z coordinate
      Returns:
      a new position of the same kind with the given amount added to the Z coordinate
    • offset

      @Contract(value="_, _, _ -> new", pure=true) BlockPosition offset(int x, int y, int z)
      Description copied from interface: Position
      Moves this position along all three axes by a whole number of blocks.
      Specified by:
      offset in interface Position
      Parameters:
      x - the amount to add to the X coordinate
      y - the amount to add to the Y coordinate
      z - the amount to add to the Z coordinate
      Returns:
      a new position of the same kind with the given amounts added to each coordinate
    • withX

      @Contract(value="_ -> new", pure=true) BlockPosition withX(int x)
      Description copied from interface: Position
      Copies this position with a different whole X coordinate.
      Specified by:
      withX in interface Position
      Parameters:
      x - the new X coordinate
      Returns:
      a new position of the same kind with the X coordinate replaced
    • withY

      @Contract(value="_ -> new", pure=true) BlockPosition withY(int y)
      Description copied from interface: Position
      Copies this position with a different whole Y coordinate.
      Specified by:
      withY in interface Position
      Parameters:
      y - the new Y coordinate
      Returns:
      a new position of the same kind with the Y coordinate replaced
    • withZ

      @Contract(value="_ -> new", pure=true) BlockPosition withZ(int z)
      Description copied from interface: Position
      Copies this position with a different whole Z coordinate.
      Specified by:
      withZ in interface Position
      Parameters:
      z - the new Z coordinate
      Returns:
      a new position of the same kind with the Z coordinate replaced
    • with

      @Contract(value="_, _, _ -> new", pure=true) BlockPosition with(int x, int y, int z)
      Description copied from interface: Position
      Copies this position with different whole coordinates.
      Specified by:
      with in interface Position
      Parameters:
      x - the new X coordinate
      y - the new Y coordinate
      z - the new Z coordinate
      Returns:
      a new position of the same kind with all coordinates replaced