public class CuboidRegionSelector extends Object implements RegionSelector, CUIRegion
| Modifier and Type | Field and Description |
|---|---|
protected BlockVector |
pos1 |
protected BlockVector |
pos2 |
protected CuboidRegion |
region |
| Constructor and Description |
|---|
CuboidRegionSelector() |
CuboidRegionSelector(LocalWorld world) |
CuboidRegionSelector(LocalWorld world,
Vector pos1,
Vector pos2) |
CuboidRegionSelector(RegionSelector oldSelector) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear the selection.
|
void |
describeCUI(LocalSession session,
LocalPlayer player)
Sends CUI events describing the region for
versions of CUI equal to or greater than the
value supplied by getProtocolVersion().
|
void |
describeLegacyCUI(LocalSession session,
LocalPlayer player)
Sends CUI events describing the region for
versions of CUI smaller than the value
supplied by getProtocolVersion().
|
void |
explainPrimarySelection(LocalPlayer player,
LocalSession session,
Vector pos)
Tell the player information about his/her primary selection.
|
void |
explainRegionAdjust(LocalPlayer player,
LocalSession session)
The the player information about the region's changes.
|
void |
explainSecondarySelection(LocalPlayer player,
LocalSession session,
Vector pos)
Tell the player information about his/her secondary selection.
|
int |
getArea()
Get the number of blocks inside the region.
|
CuboidRegion |
getIncompleteRegion()
Get the region even if it's not fully defined.
|
List<String> |
getInformationLines()
Get lines of information about the selection.
|
String |
getLegacyTypeID()
Returns the type ID to send to CUI in the selection
event if the CUI is in legacy mode.
|
BlockVector |
getPrimaryPosition()
Get the primary position.
|
int |
getProtocolVersion()
Returns the CUI version that is required to send
up-to-date data.
|
CuboidRegion |
getRegion()
Get the selection.
|
String |
getTypeID()
Returns the type ID to send to CUI in the selection event.
|
String |
getTypeName()
Get a lowercase name of this region selector type.
|
boolean |
isDefined()
Returns whether the region has been fully defined.
|
void |
learnChanges()
Update the selector with changes to the region.
|
boolean |
selectPrimary(Vector pos)
Called when the first point is selected.
|
boolean |
selectSecondary(Vector pos)
Called when the second point is selected.
|
protected BlockVector pos1
protected BlockVector pos2
protected CuboidRegion region
public CuboidRegionSelector(LocalWorld world)
public CuboidRegionSelector()
public CuboidRegionSelector(RegionSelector oldSelector)
public CuboidRegionSelector(LocalWorld world, Vector pos1, Vector pos2)
public boolean selectPrimary(Vector pos)
RegionSelectorselectPrimary in interface RegionSelectorpublic boolean selectSecondary(Vector pos)
RegionSelectorselectSecondary in interface RegionSelectorpublic void explainPrimarySelection(LocalPlayer player, LocalSession session, Vector pos)
RegionSelectorexplainPrimarySelection in interface RegionSelectorpublic void explainSecondarySelection(LocalPlayer player, LocalSession session, Vector pos)
RegionSelectorexplainSecondarySelection in interface RegionSelectorpublic void explainRegionAdjust(LocalPlayer player, LocalSession session)
RegionSelectorexplainRegionAdjust in interface RegionSelectorpublic BlockVector getPrimaryPosition() throws IncompleteRegionException
RegionSelectorgetPrimaryPosition in interface RegionSelectorIncompleteRegionExceptionpublic boolean isDefined()
RegionSelectorisDefined in interface RegionSelectorpublic CuboidRegion getRegion() throws IncompleteRegionException
RegionSelectorgetRegion in interface RegionSelectorIncompleteRegionExceptionpublic CuboidRegion getIncompleteRegion()
RegionSelectorgetIncompleteRegion in interface RegionSelectorpublic void learnChanges()
RegionSelectorlearnChanges in interface RegionSelectorpublic void clear()
RegionSelectorclear in interface RegionSelectorpublic String getTypeName()
RegionSelectorgetTypeName in interface RegionSelectorpublic List<String> getInformationLines()
RegionSelectorgetInformationLines in interface RegionSelectorpublic int getArea()
RegionSelectorgetArea in interface RegionSelectorpublic void describeCUI(LocalSession session, LocalPlayer player)
CUIRegiondescribeCUI in interface CUIRegionpublic void describeLegacyCUI(LocalSession session, LocalPlayer player)
CUIRegiondescribeLegacyCUI in interface CUIRegionpublic int getProtocolVersion()
CUIRegiongetProtocolVersion in interface CUIRegionpublic String getTypeID()
CUIRegionpublic String getLegacyTypeID()
CUIRegiongetLegacyTypeID in interface CUIRegionCopyright © 2010-2014. All Rights Reserved.