public class LocalSession extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
EXPIRATION_GRACE |
static int |
MAX_HISTORY_SIZE |
| Constructor and Description |
|---|
LocalSession(LocalConfiguration config)
Construct the object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearHistory()
Clear history.
|
EditSession |
createEditSession(LocalPlayer player)
Construct a new edit session.
|
void |
describeCUI(LocalPlayer player) |
Calendar |
detectDate(String input)
Detect date from a user's input.
|
void |
disableSuperPickAxe()
Disable super pick axe.
|
void |
dispatchCUIEvent(LocalPlayer player,
CUIEvent event)
Dispatch a CUI event but only if the player has CUI support.
|
void |
dispatchCUISelection(LocalPlayer player)
Send the selection information.
|
void |
dispatchCUISetup(LocalPlayer player)
Dispatch the initial setup CUI messages.
|
void |
enableSuperPickAxe()
Enable super pick axe.
|
BlockBag |
getBlockBag(LocalPlayer player)
Get a block bag for a player.
|
int |
getBlockChangeLimit()
Get the maximum number of blocks that can be changed in an edit session.
|
BrushTool |
getBrushTool(int item)
Get the brush tool assigned to the item.
|
CuboidClipboard |
getClipboard()
Gets the clipboard.
|
int |
getCUIVersion()
Gets the client's CUI protocol version
|
String |
getLastScript()
Get the last script used.
|
Mask |
getMask()
Get the mask.
|
Vector |
getPlacementPosition(LocalPlayer player)
Get the placement position.
|
Region |
getRegion()
Deprecated.
|
RegionSelector |
getRegionSelector()
Deprecated.
|
RegionSelector |
getRegionSelector(LocalWorld world)
Get the region selector for defining the selection.
|
Region |
getSelection(LocalWorld world)
Get the selection region.
|
LocalWorld |
getSelectionWorld()
Get the selection world.
|
Snapshot |
getSnapshot()
Get the snapshot that has been selected.
|
BlockTool |
getSuperPickaxe() |
TimeZone |
getTimeZone()
Get the session's timezone.
|
Tool |
getTool(int item)
Get the tool assigned to the item.
|
void |
handleCUIInitializationMessage(String text) |
boolean |
hasCUISupport()
Gets the status of CUI support.
|
boolean |
hasExpired()
Returns whether this session has expired.
|
boolean |
hasFastMode()
Checks if the session has fast mode enabled.
|
boolean |
hasSuperPickAxe()
Checks whether the super pick axe is enabled.
|
boolean |
isRegionDefined()
Deprecated.
|
boolean |
isSelectionDefined(LocalWorld world)
Returns true if the region is fully defined for the specified world.
|
boolean |
isToolControlEnabled()
See if tool control is enabled.
|
boolean |
isUsingInventory()
Returns whether inventory usage is enabled for this session.
|
EditSession |
redo(BlockBag newBlockBag,
LocalPlayer player)
Performs a redo
|
void |
remember(EditSession editSession)
Remember an edit session for the undo history.
|
void |
setBlockChangeLimit(int maxBlocksChanged)
Set the maximum number of blocks that can be changed.
|
void |
setClipboard(CuboidClipboard clipboard)
Sets the clipboard.
|
void |
setCUISupport(boolean support)
Sets the status of CUI support.
|
void |
setCUIVersion(int CUIVersion)
Sets the client's CUI protocol version
|
void |
setFastMode(boolean fastMode)
Set fast mode.
|
void |
setLastScript(String lastScript)
Set the last script used.
|
void |
setMask(Mask mask)
Set a mask.
|
void |
setRegionSelector(LocalWorld world,
RegionSelector selector)
Set the region selector.
|
void |
setSnapshot(Snapshot snapshot)
Select a snapshot.
|
void |
setSuperPickaxe(BlockTool tool)
Set the super pickaxe tool.
|
void |
setTimezone(TimeZone timezone)
Set the session's timezone.
|
void |
setTool(int item,
Tool tool)
Set the tool.
|
void |
setToolControl(boolean toolControl)
Change tool control setting.
|
void |
setUseInventory(boolean useInventory)
Set the state of inventory usage.
|
void |
tellVersion(LocalPlayer player)
Tell the player the WorldEdit version.
|
boolean |
togglePlacementPosition()
Toggle placement position.
|
boolean |
toggleSuperPickAxe()
Toggle the super pick axe.
|
EditSession |
undo(BlockBag newBlockBag,
LocalPlayer player)
Performs an undo.
|
void |
update()
Update the last update time for calculating expiration.
|
public static int MAX_HISTORY_SIZE
public static int EXPIRATION_GRACE
public LocalSession(LocalConfiguration config)
config - public TimeZone getTimeZone()
public void setTimezone(TimeZone timezone)
timezone - public void clearHistory()
public void remember(EditSession editSession)
editSession - public EditSession undo(BlockBag newBlockBag, LocalPlayer player)
newBlockBag - player - public EditSession redo(BlockBag newBlockBag, LocalPlayer player)
newBlockBag - player - public RegionSelector getRegionSelector(LocalWorld world)
world - @Deprecated public RegionSelector getRegionSelector()
public void setRegionSelector(LocalWorld world, RegionSelector selector)
world - selector - @Deprecated public boolean isRegionDefined()
public boolean isSelectionDefined(LocalWorld world)
world - @Deprecated public Region getRegion() throws IncompleteRegionException
getSelection().IncompleteRegionExceptionpublic Region getSelection(LocalWorld world) throws IncompleteRegionException
IncompleteRegionException
exception will be thrown.world - IncompleteRegionExceptionpublic LocalWorld getSelectionWorld()
public CuboidClipboard getClipboard() throws EmptyClipboardException
EmptyClipboardExceptionpublic void setClipboard(CuboidClipboard clipboard)
clipboard - public boolean isToolControlEnabled()
public void setToolControl(boolean toolControl)
toolControl - public int getBlockChangeLimit()
public void setBlockChangeLimit(int maxBlocksChanged)
maxBlocksChanged - public boolean hasSuperPickAxe()
public void enableSuperPickAxe()
public void disableSuperPickAxe()
public boolean toggleSuperPickAxe()
public Vector getPlacementPosition(LocalPlayer player) throws IncompleteRegionException
player - IncompleteRegionExceptionpublic boolean togglePlacementPosition()
public BlockBag getBlockBag(LocalPlayer player)
player - public Snapshot getSnapshot()
public void setSnapshot(Snapshot snapshot)
snapshot - public BlockTool getSuperPickaxe()
public void setSuperPickaxe(BlockTool tool)
tool - public Tool getTool(int item)
item - public BrushTool getBrushTool(int item) throws InvalidToolBindException
item - InvalidToolBindExceptionpublic void setTool(int item,
Tool tool)
throws InvalidToolBindException
item - tool - the tool to setInvalidToolBindExceptionpublic boolean isUsingInventory()
public void setUseInventory(boolean useInventory)
useInventory - the useInventory to setpublic String getLastScript()
public void setLastScript(String lastScript)
lastScript - the lastScript to setpublic void tellVersion(LocalPlayer player)
player - public void dispatchCUIEvent(LocalPlayer player, CUIEvent event)
player - event - public void dispatchCUISetup(LocalPlayer player)
player - public void dispatchCUISelection(LocalPlayer player)
player - public void describeCUI(LocalPlayer player)
public void handleCUIInitializationMessage(String text)
public boolean hasCUISupport()
public void setCUISupport(boolean support)
support - public int getCUIVersion()
public void setCUIVersion(int CUIVersion)
CUIVersion - public Calendar detectDate(String input)
input - public void update()
public boolean hasExpired()
public EditSession createEditSession(LocalPlayer player)
player - public boolean hasFastMode()
public void setFastMode(boolean fastMode)
fastMode - public Mask getMask()
public void setMask(Mask mask)
mask - mask or nullCopyright © 2010-2014. All Rights Reserved.