Package com.sk89q.worldedit.regions
Interface RegionSelector
- All Known Implementing Classes:
ConvexPolyhedralRegionSelector
,CuboidRegionSelector
,CylinderRegionSelector
,EllipsoidRegionSelector
,ExtendingCuboidRegionSelector
,FuzzyRegionSelector
,Polygonal2DRegionSelector
,PolyhedralRegionSelector
,SphereRegionSelector
public interface RegionSelector
Region selectors create
Region
s from a series of "selected points."
They are used, for example, to allow users to create a CuboidRegion
by selecting two corners of the cuboid.-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear the selection.void
explainPrimarySelection
(Actor actor, LocalSession session, BlockVector3 position) Tell the player information about his/her primary selection.void
explainRegionAdjust
(Actor actor, LocalSession session) Tell the player information about the region's changes.void
explainSecondarySelection
(Actor actor, LocalSession session, BlockVector3 position) Tell the player information about his/her secondary selection.default int
getArea()
Deprecated.Get the region even if it's not fully defined.Deprecated.Get the primary position.Get the selection.default List
<com.sk89q.worldedit.util.formatting.text.Component> Get lines of information about the selection.Get a lowercase name of this region selector type.default List
<BlockVector3> Get the vertices.default long
Get the number of blocks inside the region.getWorld()
Get the world for the region selector.boolean
Returns whether the region has been fully defined.void
Update the selector with changes to the region.boolean
selectPrimary
(BlockVector3 position, SelectorLimits limits) Called when the first point is selected.boolean
selectSecondary
(BlockVector3 position, SelectorLimits limits) Called when the second point is selected.void
Set the world for the region selector.
-
Method Details
-
getWorld
Get the world for the region selector.- Returns:
- a world, which may be null
-
setWorld
Set the world for the region selector.- Parameters:
world
- the world, which may be null
-
selectPrimary
Called when the first point is selected.- Parameters:
position
- the position- Returns:
- true if something changed
-
selectSecondary
Called when the second point is selected.- Parameters:
position
- the position- Returns:
- true if something changed
-
explainPrimarySelection
Tell the player information about his/her primary selection.- Parameters:
actor
- the actorsession
- the sessionposition
- position
-
explainSecondarySelection
Tell the player information about his/her secondary selection.- Parameters:
actor
- the actorsession
- the sessionposition
- position
-
explainRegionAdjust
Tell the player information about the region's changes. This may resend all the defining region information if needed.- Parameters:
actor
- the actorsession
- the session
-
getPrimaryPosition
Get the primary position.- Returns:
- the primary position
- Throws:
IncompleteRegionException
- thrown if a region has not been fully defined
-
getRegion
Get the selection.- Returns:
- the created region
- Throws:
IncompleteRegionException
- thrown if a region has not been fully defined
-
getIncompleteRegion
Region getIncompleteRegion()Get the region even if it's not fully defined.- Returns:
- an incomplete region object that is incomplete
-
isDefined
boolean isDefined()Returns whether the region has been fully defined.- Returns:
- true if a selection is available
-
getArea
Deprecated.usegetVolume()
Get the number of blocks inside the region.- Returns:
- number of blocks, or -1 if undefined
-
getVolume
Get the number of blocks inside the region.- Returns:
- number of blocks, or -1 if undefined
-
learnChanges
void learnChanges()Update the selector with changes to the region. -
clear
void clear()Clear the selection. -
getTypeName
String getTypeName()Get a lowercase name of this region selector type.- Returns:
- a lower case name of the type
-
getInformationLines
Deprecated.Get lines of information about the selection.- Returns:
- a list of lines describing the region
-
getSelectionInfoLines
Get lines of information about the selection.- Returns:
- a list of lines describing the region.
-
getVertices
Get the vertices.- Returns:
- the list of vertices
- Throws:
IncompleteRegionException
- thrown if a region has not been fully defined
-
getVolume()