Class ProtectedPolygonalRegion

java.lang.Object
com.sk89q.worldguard.protection.regions.ProtectedRegion
com.sk89q.worldguard.protection.regions.ProtectedPolygonalRegion
All Implemented Interfaces:
ChangeTracked, Comparable<ProtectedRegion>

public class ProtectedPolygonalRegion extends ProtectedRegion
  • Constructor Details

    • ProtectedPolygonalRegion

      public ProtectedPolygonalRegion(String id, List<com.sk89q.worldedit.math.BlockVector2> points, int minY, int maxY)
      Construct a new instance of this polygonal region.
      Equivalent to ProtectedPolygonalRegion(id, false, points, minY, maxY)
      transientRegion will be set to false, and this region can be saved.
      Parameters:
      id - the region id
      points - a List of points that this region should contain
      minY - the minimum y coordinate
      maxY - the maximum y coordinate
    • ProtectedPolygonalRegion

      public ProtectedPolygonalRegion(String id, boolean transientRegion, List<com.sk89q.worldedit.math.BlockVector2> points, int minY, int maxY)
      Construct a new instance of this polygonal region.
      Parameters:
      id - the region id
      transientRegion - whether this region should only be kept in memory and not be saved
      points - a List of points that this region should contain
      minY - the minimum y coordinate
      maxY - the maximum y coordinate
  • Method Details

    • isPhysicalArea

      public boolean isPhysicalArea()
      Description copied from class: ProtectedRegion
      Return whether this type of region encompasses physical area.
      Specified by:
      isPhysicalArea in class ProtectedRegion
      Returns:
      Whether physical area is encompassed
    • getPoints

      public List<com.sk89q.worldedit.math.BlockVector2> getPoints()
      Description copied from class: ProtectedRegion
      Get points of the region projected onto the X-Z plane.
      Specified by:
      getPoints in class ProtectedRegion
      Returns:
      the points
    • contains

      public boolean contains(com.sk89q.worldedit.math.BlockVector3 position)
      Description copied from class: ProtectedRegion
      Check to see if a point is inside this region.
      Specified by:
      contains in class ProtectedRegion
      Parameters:
      position - The point to check
      Returns:
      Whether pt is in this region
    • getType

      public RegionType getType()
      Description copied from class: ProtectedRegion
      Get the type of region.
      Specified by:
      getType in class ProtectedRegion
      Returns:
      the type
    • volume

      public int volume()
      Description copied from class: ProtectedRegion
      Get the number of blocks in this region.
      Specified by:
      volume in class ProtectedRegion
      Returns:
      the volume of this region in blocks