Interface Area

All Superinterfaces:
Iterable<BlockVec>
All Known Subinterfaces:
Area.Cuboid, Area.Line, Area.Single, Area.Sphere

@Experimental public sealed interface Area extends Iterable<BlockVec> permits Area.Single, Area.Line, Area.Cuboid, Area.Sphere
Represents a collection of aligned block coordinates in a 3D space.

If switched over, consider a fallback to the iterator as more implementations may be added in the future.

  • Method Details

    • offset

      default Area offset(int x, int y, int z)
    • offset

      default Area offset(Point offset)
    • bound

      default Area.Cuboid bound()
      Returns the bounding box of this
      Returns:
      a cuboid representing the bounding box with the lowest and highest points
    • split

      List<Area.Cuboid> split()
      Splits this area into multiple section aligned cuboids.

      Single sections may have multiple cuboids if they are not perfect cuboids.

      Returns:
      list of sub-cuboids covering this area
    • single

      static Area.Single single(Point point)
    • single

      static Area.Single single(int x, int y, int z)
    • line

      static Area.Line line(Point start, Point end)
    • cuboid

      static Area.Cuboid cuboid(Point min, Point max)
    • cube

      static Area.Cuboid cube(Point center, int size)
    • box

      static Area.Cuboid box(Point center, Point size)
    • section

      static Area.Cuboid section(int sectionX, int sectionY, int sectionZ)
    • sphere

      static Area.Sphere sphere(Point center, int radius)