Class ProtectedCuboidRegion
java.lang.Object
com.sk89q.worldguard.protection.regions.ProtectedRegion
com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion
- All Implemented Interfaces:
ChangeTracked,Comparable<ProtectedRegion>
Represents a cuboid region that can be protected.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.sk89q.worldguard.protection.regions.ProtectedRegion
ProtectedRegion.CircularInheritanceException -
Field Summary
Fields inherited from class com.sk89q.worldguard.protection.regions.ProtectedRegion
GLOBAL_REGION, max, min -
Constructor Summary
ConstructorsConstructorDescriptionProtectedCuboidRegion(String id, boolean transientRegion, com.sk89q.worldedit.math.BlockVector3 pt1, com.sk89q.worldedit.math.BlockVector3 pt2)Construct a new instance of this cuboid region.ProtectedCuboidRegion(String id, com.sk89q.worldedit.math.BlockVector3 pt1, com.sk89q.worldedit.math.BlockVector3 pt2)Construct a new instance of this cuboid region.
Equivalent toProtectedCuboidRegion(id, false, pt1, pt2)
transientRegionwill be set to false, and this region can be saved. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(com.sk89q.worldedit.math.BlockVector3 pt)Check to see if a point is inside this region.List<com.sk89q.worldedit.math.BlockVector2>Get points of the region projected onto the X-Z plane.getType()Get the type of region.protected booleanintersects(ProtectedRegion region, Area thisArea)Test whether the given region intersects with this area.booleanReturn whether this type of region encompasses physical area.voidsetMaximumPoint(com.sk89q.worldedit.math.BlockVector3 position)Deprecated.ProtectedRegion bounds should never be mutated.voidsetMinimumPoint(com.sk89q.worldedit.math.BlockVector3 position)Deprecated.ProtectedRegion bounds should never be mutated.intvolume()Get the number of blocks in this region.Methods inherited from class com.sk89q.worldguard.protection.regions.ProtectedRegion
clearParent, compareTo, contains, contains, containsAny, copyFrom, getFlag, getFlags, getId, getIntersectingRegions, getMaximumPoint, getMembers, getMinimumPoint, getOwners, getParent, getPriority, hashCode, hasMembersOrOwners, intersectsBoundingBox, intersectsEdges, isDirty, isMember, isMember, isMemberOnly, isOwner, isOwner, isTransient, isValidId, setDirty, setFlag, setFlags, setMembers, setMinMaxPoints, setOwners, setParent, setPriority, toString
-
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 toProtectedCuboidRegion(id, false, pt1, pt2)
transientRegionwill be set to false, and this region can be saved.- Parameters:
id- the region idpt1- the first point of this regionpt2- 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 idtransientRegion- whether this region should only be kept in memory and not be savedpt1- the first point of this regionpt2- the second point of this region
-
-
Method Details
-
setMinimumPoint
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.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:ProtectedRegionReturn whether this type of region encompasses physical area.- Specified by:
isPhysicalAreain classProtectedRegion- Returns:
- Whether physical area is encompassed
-
getPoints
Description copied from class:ProtectedRegionGet points of the region projected onto the X-Z plane.- Specified by:
getPointsin classProtectedRegion- Returns:
- the points
-
contains
public boolean contains(com.sk89q.worldedit.math.BlockVector3 pt)Description copied from class:ProtectedRegionCheck to see if a point is inside this region.- Specified by:
containsin classProtectedRegion- Parameters:
pt- The point to check- Returns:
- Whether
ptis in this region
-
getType
Description copied from class:ProtectedRegionGet the type of region.- Specified by:
getTypein classProtectedRegion- Returns:
- the type
-
intersects
Description copied from class:ProtectedRegionTest whether the given region intersects with this area.- Overrides:
intersectsin classProtectedRegion- Parameters:
region- the region to testthisArea- an area object for this region- Returns:
- true if the two regions intersect
-
volume
public int volume()Description copied from class:ProtectedRegionGet the number of blocks in this region.- Specified by:
volumein classProtectedRegion- Returns:
- the volume of this region in blocks
-