public interface RegionSelector
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.Modifier and Type | Method and Description |
---|---|
void |
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.
use
getVolume() |
Region |
getIncompleteRegion()
Get the region even if it's not fully defined.
|
default java.util.List<java.lang.String> |
getInformationLines()
Deprecated.
|
BlockVector3 |
getPrimaryPosition()
Get the primary position.
|
Region |
getRegion()
Get the selection.
|
default java.util.List<com.sk89q.worldedit.util.formatting.text.Component> |
getSelectionInfoLines()
Get lines of information about the selection.
|
java.lang.String |
getTypeName()
Get a lowercase name of this region selector type.
|
default long |
getVolume()
Get the number of blocks inside the region.
|
World |
getWorld()
Get the world for the region selector.
|
boolean |
isDefined()
Returns whether the region has been fully defined.
|
void |
learnChanges()
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 |
setWorld(World world)
Set the world for the region selector.
|
@Nullable World getWorld()
void setWorld(@Nullable World world)
world
- the world, which may be nullboolean selectPrimary(BlockVector3 position, SelectorLimits limits)
position
- the positionboolean selectSecondary(BlockVector3 position, SelectorLimits limits)
position
- the positionvoid explainPrimarySelection(Actor actor, LocalSession session, BlockVector3 position)
actor
- the actorsession
- the sessionposition
- positionvoid explainSecondarySelection(Actor actor, LocalSession session, BlockVector3 position)
actor
- the actorsession
- the sessionposition
- positionvoid explainRegionAdjust(Actor actor, LocalSession session)
actor
- the actorsession
- the sessionBlockVector3 getPrimaryPosition() throws IncompleteRegionException
IncompleteRegionException
- thrown if a region has not been fully definedRegion getRegion() throws IncompleteRegionException
IncompleteRegionException
- thrown if a region has not been fully definedRegion getIncompleteRegion()
boolean isDefined()
@Deprecated default int getArea()
getVolume()
@NonAbstractForCompatibility(delegateName="getArea", delegateParams={}) default long getVolume()
NonAbstractForCompatibility
for detailsvoid learnChanges()
void clear()
java.lang.String getTypeName()
@Deprecated default java.util.List<java.lang.String> getInformationLines()
default java.util.List<com.sk89q.worldedit.util.formatting.text.Component> getSelectionInfoLines()