Class ProtectedCuboidRegion

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

public class ProtectedCuboidRegion extends ProtectedRegion
Represents a cuboid region that can be protected.
  • Constructor Details

    • ProtectedCuboidRegion

      public ProtectedCuboidRegion(String id, com.sk89q.worldedit.math.BlockVector3 pt1, com.sk89q.worldedit.math.BlockVector3 pt2)
      Construct a new instance of this cuboid region.
      Equivalent to ProtectedCuboidRegion(id, false, pt1, pt2)
      transientRegion will be set to false, and this region can be saved.
      Parameters:
      id - the region id
      pt1 - the first point of this region
      pt2 - the second point of this region
    • ProtectedCuboidRegion

      public ProtectedCuboidRegion(String id, boolean transientRegion, com.sk89q.worldedit.math.BlockVector3 pt1, com.sk89q.worldedit.math.BlockVector3 pt2)
      Construct a new instance of this cuboid region.
      Parameters:
      id - the region id
      transientRegion - whether this region should only be kept in memory and not be saved
      pt1 - the first point of this region
      pt2 - the second point of this region
  • Method Details

    • setMinimumPoint

      @Deprecated public void setMinimumPoint(com.sk89q.worldedit.math.BlockVector3 position)
      Deprecated.
      ProtectedRegion bounds should never be mutated. Regions must be redefined to move them. This method will be removed in a future release.
      Set the lower point of the cuboid.
      Parameters:
      position - the point to set as the minimum point
    • setMaximumPoint

      @Deprecated public void setMaximumPoint(com.sk89q.worldedit.math.BlockVector3 position)
      Deprecated.
      ProtectedRegion bounds should never be mutated. Regions must be redefined to move them. This method will be removed in a future release.
      Set the upper point of the cuboid.
      Parameters:
      position - the point to set as the maximum point
    • 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 pt)
      Description copied from class: ProtectedRegion
      Check to see if a point is inside this region.
      Specified by:
      contains in class ProtectedRegion
      Parameters:
      pt - 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
    • intersects

      protected boolean intersects(ProtectedRegion region, Area thisArea)
      Description copied from class: ProtectedRegion
      Test whether the given region intersects with this area.
      Overrides:
      intersects in class ProtectedRegion
      Parameters:
      region - the region to test
      thisArea - an area object for this region
      Returns:
      true if the two regions intersect
    • 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