Interface Area

All Superinterfaces:
Iterable<org.joml.Vector3ic>
All Known Implementing Classes:
CuboidArea, EncompassingArea, PolygonArea, PolyhedralArea, SphericalArea

public sealed interface Area extends Iterable<org.joml.Vector3ic> permits EncompassingArea
Represents some area that forms a shape through a set of points.

Areas are non-locational; they do not contain any world-specific data.

Instead, a world contains a set of Areas.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<Area>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    addPoint(org.joml.Vector3ic point)
    Attempts to add a point to this area.
    void
    Removes all points from this area.
    boolean
    contains(double x, double y, double z)
    Gets whether the specified point is within this area.
    boolean
    contains(org.joml.Vector3dc point)
     
    Set<org.joml.Vector3ic>
    Returns a set of points representing the boundary of this area.
    org.joml.Vector3ic
    Gets the maximum point of this area.
    org.joml.Vector3ic
    Gets the minimum point of this area.
     
    Set<org.joml.Vector3ic>
    Gets the set of points that make up this area.
    boolean
    removePoint(org.joml.Vector3ic point)
    Attempts to remove a point from this area.

    Methods inherited from interface java.lang.Iterable

    forEach, iterator, spliterator
  • Field Details

    • CODEC

      static final com.mojang.serialization.Codec<Area> CODEC
  • Method Details

    • clearPoints

      void clearPoints()
      Removes all points from this area.
    • addPoint

      boolean addPoint(org.joml.Vector3ic point)
      Attempts to add a point to this area.

      This method will return false if the area does not support the addition of another point, e.g. a cuboid exceeding 4 points.

      Parameters:
      point - the point to add
      Returns:
      true if the point is able to fit into this area
    • removePoint

      boolean removePoint(org.joml.Vector3ic point)
      Attempts to remove a point from this area.

      This method will return as specified by Set.remove(Object).

      Parameters:
      point - the point to remove
      Returns:
      specified by Set.remove(Object)
    • contains

      boolean contains(org.joml.Vector3dc point)
      See Also:
    • contains

      boolean contains(double x, double y, double z)
      Gets whether the specified point is within this area.

      This method will always return false if the area is incomplete.

      Parameters:
      x - the x point to check
      y - the y point to check
      z - the z point to check
      Returns:
      true if the point is within the area specified by points()
    • getMin

      org.joml.Vector3ic getMin()
      Gets the minimum point of this area.

      This method does not guarantee returning a Vector3i from points(); it is the minimum bounds point.

      Returns:
      the minimum point
    • getMax

      org.joml.Vector3ic getMax()
      Gets the maximum point of this area.

      This method does not guarantee returning a Vector3i from points(); it is the maximum bounds point.

      Returns:
      the maximum point
    • points

      Set<org.joml.Vector3ic> points()
      Gets the set of points that make up this area.

      The returned set cannot be modified.

      Returns:
      set of points of this area
    • getBoundaryPoints

      Set<org.joml.Vector3ic> getBoundaryPoints()
      Returns a set of points representing the boundary of this area.
    • getType

      AreaType<?> getType()