public class WorldEdit extends Object
| Modifier and Type | Field and Description |
|---|---|
Logger |
commandLogger |
static Logger |
logger
Logger for debugging.
|
| Constructor and Description |
|---|
WorldEdit(ServerInterface server,
LocalConfiguration config)
Construct an instance of the plugin
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkMaxBrushRadius(double radius)
Checks to see if the specified brush radius is within bounds.
|
void |
checkMaxRadius(double radius)
Checks to see if the specified radius is within bounds.
|
void |
clearSessions()
Remove all sessions.
|
String[] |
commandDetection(String[] split) |
static int |
divisorMod(int a,
int n)
Modulus, divisor-style.
|
void |
flushBlockBag(LocalPlayer player,
EditSession editSession)
Flush a block bag's changes to a player.
|
void |
flushExpiredSessions(SessionCheck checker) |
void |
forgetPlayer(LocalPlayer player)
Forget a player.
|
BaseBlock |
getBlock(LocalPlayer player,
String id)
Get a block.
|
BaseBlock |
getBlock(LocalPlayer player,
String arg,
boolean allAllowed) |
BaseBlock |
getBlock(LocalPlayer player,
String arg,
boolean allAllowed,
boolean allowNoData)
Get an item ID from an item name or an item ID number.
|
Set<Integer> |
getBlockIDs(LocalPlayer player,
String list,
boolean allBlocksAllowed)
Get a list of blocks as a set.
|
Mask |
getBlockMask(LocalPlayer player,
LocalSession session,
String maskString)
Get a block mask.
|
Pattern |
getBlockPattern(LocalPlayer player,
String patternString)
Returns a Pattern corresponding to the specified pattern string,
as given by the player on the command line.
|
Set<BaseBlock> |
getBlocks(LocalPlayer player,
String list) |
Set<BaseBlock> |
getBlocks(LocalPlayer player,
String list,
boolean allAllowed) |
Set<BaseBlock> |
getBlocks(LocalPlayer player,
String list,
boolean allAllowed,
boolean allowNoData) |
Map<String,String> |
getCommands() |
CommandsManager<LocalPlayer> |
getCommandsManager() |
LocalConfiguration |
getConfiguration()
Get Worldedit's configuration.
|
Vector |
getDiagonalDirection(LocalPlayer player,
String dirStr)
Get diagonal direction vector for a player's direction.
|
Vector |
getDirection(LocalPlayer player,
String dirStr)
Get the direction vector for a player's direction.
|
EditSessionFactory |
getEditSessionFactory()
Get the edit session factory
|
CuboidClipboard.FlipDirection |
getFlipDirection(LocalPlayer player,
String dirStr)
Get the flip direction for a player's direction.
|
static WorldEdit |
getInstance()
Gets the current instance of this class
|
int |
getMaximumPolygonalPoints(LocalPlayer player) |
int |
getMaximumPolyhedronPoints(LocalPlayer player) |
File |
getSafeOpenFile(LocalPlayer player,
File dir,
String filename,
String defaultExt,
String... extensions)
Gets the path to a file.
|
File |
getSafeSaveFile(LocalPlayer player,
File dir,
String filename,
String defaultExt,
String... extensions)
Gets the path to a file.
|
ServerInterface |
getServer()
Get the server interface.
|
LocalSession |
getSession(LocalPlayer player)
Gets the WorldEdit session for a player.
|
LocalSession |
getSession(String player)
Gets the LocalSession for a player name if it exists
|
static String |
getVersion()
Get the version.
|
File |
getWorkingDirectoryFile(String path)
Get a file relative to the defined working directory.
|
boolean |
handleArmSwing(LocalPlayer player)
Called on arm swing.
|
boolean |
handleBlockLeftClick(LocalPlayer player,
WorldVector clicked)
Called on left click.
|
boolean |
handleBlockRightClick(LocalPlayer player,
WorldVector clicked)
Called on right click.
|
boolean |
handleCommand(LocalPlayer player,
String[] split) |
void |
handleDisconnect(LocalPlayer player)
Deprecated.
|
boolean |
handleRightClick(LocalPlayer player)
Called on right click (not on a block).
|
boolean |
hasSession(LocalPlayer player)
Returns true if the player has a session.
|
void |
markExpire(LocalPlayer player) |
void |
removeSession(LocalPlayer player)
Remove a session.
|
void |
runScript(LocalPlayer player,
File f,
String[] args)
Executes a WorldEdit script.
|
void |
setEditSessionFactory(EditSessionFactory factory)
Set the edit session factory
|
static void |
setVersion(String version) |
public static final Logger logger
public final Logger commandLogger
public WorldEdit(ServerInterface server, LocalConfiguration config)
server - config - public static WorldEdit getInstance()
public LocalSession getSession(String player)
player - public LocalSession getSession(LocalPlayer player)
player - public boolean hasSession(LocalPlayer player)
player - public BaseBlock getBlock(LocalPlayer player, String arg, boolean allAllowed) throws WorldEditException
WorldEditExceptionpublic BaseBlock getBlock(LocalPlayer player, String arg, boolean allAllowed, boolean allowNoData) throws WorldEditException
player - arg - allAllowed - true to ignore blacklistsallowNoData - return -1 for data if no data was given.UnknownItemExceptionDisallowedItemExceptionWorldEditExceptionpublic BaseBlock getBlock(LocalPlayer player, String id) throws WorldEditException
player - id - UnknownItemExceptionDisallowedItemExceptionWorldEditExceptionpublic Set<BaseBlock> getBlocks(LocalPlayer player, String list, boolean allAllowed, boolean allowNoData) throws WorldEditException
WorldEditExceptionpublic Set<BaseBlock> getBlocks(LocalPlayer player, String list, boolean allAllowed) throws WorldEditException
WorldEditExceptionpublic Set<BaseBlock> getBlocks(LocalPlayer player, String list) throws WorldEditException
WorldEditExceptionpublic Pattern getBlockPattern(LocalPlayer player, String patternString) throws WorldEditException
player - patternString - UnknownItemExceptionDisallowedItemExceptionWorldEditExceptionpublic Mask getBlockMask(LocalPlayer player, LocalSession session, String maskString) throws WorldEditException
player - session - maskString - WorldEditExceptionpublic Set<Integer> getBlockIDs(LocalPlayer player, String list, boolean allBlocksAllowed) throws WorldEditException
player - list - allBlocksAllowed - UnknownItemExceptionDisallowedItemExceptionWorldEditExceptionpublic File getSafeSaveFile(LocalPlayer player, File dir, String filename, String defaultExt, String... extensions) throws FilenameException
java.io.File object will be returned.player - dir - sub-directory to look infilename - filename (user-submitted)defaultExt - append an extension if missing one, null to not useextensions - list of extensions, null for anyFilenameExceptionpublic File getSafeOpenFile(LocalPlayer player, File dir, String filename, String defaultExt, String... extensions) throws FilenameException
java.io.File object will be returned.player - dir - sub-directory to look infilename - filename (user-submitted)defaultExt - append an extension if missing one, null to not useextensions - list of extensions, null for anyFilenameExceptionpublic int getMaximumPolygonalPoints(LocalPlayer player)
public int getMaximumPolyhedronPoints(LocalPlayer player)
public void checkMaxRadius(double radius)
throws MaxRadiusException
radius - MaxRadiusExceptionpublic void checkMaxBrushRadius(double radius)
throws MaxBrushRadiusException
radius - MaxBrushRadiusExceptionpublic File getWorkingDirectoryFile(String path)
path - public static int divisorMod(int a,
int n)
a - n - public Vector getDirection(LocalPlayer player, String dirStr) throws UnknownDirectionException
player - dirStr - UnknownDirectionExceptionpublic Vector getDiagonalDirection(LocalPlayer player, String dirStr) throws UnknownDirectionException
player - dirStr - UnknownDirectionExceptionpublic CuboidClipboard.FlipDirection getFlipDirection(LocalPlayer player, String dirStr) throws UnknownDirectionException
player - dirStr - UnknownDirectionExceptionpublic void removeSession(LocalPlayer player)
player - public void clearSessions()
public void flushBlockBag(LocalPlayer player, EditSession editSession)
player - editSession - public CommandsManager<LocalPlayer> getCommandsManager()
@Deprecated public void handleDisconnect(LocalPlayer player)
player - public void markExpire(LocalPlayer player)
player - public void forgetPlayer(LocalPlayer player)
player - public void flushExpiredSessions(SessionCheck checker)
public boolean handleArmSwing(LocalPlayer player)
player - public boolean handleRightClick(LocalPlayer player)
player - public boolean handleBlockRightClick(LocalPlayer player, WorldVector clicked)
player - clicked - public boolean handleBlockLeftClick(LocalPlayer player, WorldVector clicked)
player - clicked - public boolean handleCommand(LocalPlayer player, String[] split)
player - split - public void runScript(LocalPlayer player, File f, String[] args) throws WorldEditException
player - f - args - WorldEditExceptionpublic LocalConfiguration getConfiguration()
public ServerInterface getServer()
public EditSessionFactory getEditSessionFactory()
public void setEditSessionFactory(EditSessionFactory factory)
factory - public static String getVersion()
public static void setVersion(String version)
Copyright © 2010-2014. All Rights Reserved.