public class CuboidClipboard extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
CuboidClipboard.FlipDirection
Flip direction.
|
| Constructor and Description |
|---|
CuboidClipboard(Vector size)
Constructs the clipboard.
|
CuboidClipboard(Vector size,
Vector origin)
Constructs the clipboard.
|
CuboidClipboard(Vector size,
Vector origin,
Vector offset)
Constructs the clipboard.
|
| Modifier and Type | Method and Description |
|---|---|
void |
copy(EditSession editSession)
Copies blocks to the clipboard.
|
void |
copy(EditSession editSession,
Region region)
Copies blocks to the clipboard.
|
void |
flip(CuboidClipboard.FlipDirection dir)
Flip the clipboard.
|
void |
flip(CuboidClipboard.FlipDirection dir,
boolean aroundPlayer)
Flip the clipboard.
|
BaseBlock |
getBlock(Vector pos)
Get one point in the copy.
|
List<Countable<Integer>> |
getBlockDistribution()
Get the block distribution inside a clipboard.
|
List<Countable<BaseBlock>> |
getBlockDistributionWithData()
Get the block distribution inside a clipboard with data values.
|
int |
getHeight()
Get the height (Y-direction) of the clipboard.
|
int |
getLength()
Get the length (Z-direction) of the clipboard.
|
Vector |
getOffset() |
Vector |
getOrigin() |
BaseBlock |
getPoint(Vector pos)
Deprecated.
Use
getBlock(Vector) instead |
Vector |
getSize()
Get the size of the copy.
|
int |
getWidth()
Get the width (X-direction) of the clipboard.
|
static CuboidClipboard |
loadSchematic(File path)
Deprecated.
|
void |
paste(EditSession editSession,
Vector newOrigin,
boolean noAir) |
void |
paste(EditSession editSession,
Vector newOrigin,
boolean noAir,
boolean entities)
Paste from the clipboard.
|
LocalEntity[] |
pasteEntities(Vector pos) |
void |
place(EditSession editSession,
Vector pos,
boolean noAir)
Places the blocks in a position from the minimum corner.
|
void |
rotate2D(int angle)
Rotate the clipboard in 2D.
|
void |
saveSchematic(File path)
Deprecated.
|
void |
setBlock(Vector pt,
BaseBlock block)
Set one point in the copy.
|
void |
setOffset(Vector offset) |
void |
setOrigin(Vector origin) |
void |
storeEntity(LocalEntity entity) |
public CuboidClipboard(Vector size)
size - public CuboidClipboard(Vector size, Vector origin)
size - origin - public int getWidth()
public int getLength()
public int getHeight()
public void rotate2D(int angle)
angle - in degreespublic void flip(CuboidClipboard.FlipDirection dir)
dir - direction to flippublic void flip(CuboidClipboard.FlipDirection dir, boolean aroundPlayer)
dir - direction to fliparoundPlayer - flip the offset around the playerpublic void copy(EditSession editSession)
editSession - The EditSession from which to take the blockspublic void copy(EditSession editSession, Region region)
editSession - The EditSession from which to take the blocksregion - A region that further constrains which blocks to take.public void paste(EditSession editSession, Vector newOrigin, boolean noAir) throws MaxChangedBlocksException
MaxChangedBlocksExceptionpublic void paste(EditSession editSession, Vector newOrigin, boolean noAir, boolean entities) throws MaxChangedBlocksException
editSession - newOrigin - Position to paste it fromnoAir - True to not paste airMaxChangedBlocksExceptionpublic void place(EditSession editSession, Vector pos, boolean noAir) throws MaxChangedBlocksException
editSession - pos - noAir - MaxChangedBlocksExceptionpublic LocalEntity[] pasteEntities(Vector pos)
public void storeEntity(LocalEntity entity)
public BaseBlock getPoint(Vector pos) throws ArrayIndexOutOfBoundsException
getBlock(Vector) insteadThe - point, relative to the origin of the copy (0, 0, 0) and not to the actual copy origin.ArrayIndexOutOfBoundsException - if the position is outside the bounds of the CuboidClipboardpublic BaseBlock getBlock(Vector pos) throws ArrayIndexOutOfBoundsException
The - point, relative to the origin of the copy (0, 0, 0) and not to the actual copy origin.ArrayIndexOutOfBoundsException - if the position is outside the bounds of the CuboidClipboardpublic void setBlock(Vector pt, BaseBlock block)
The - point, relative to the origin of the copy (0, 0, 0) and not to the actual copy origin.ArrayIndexOutOfBoundsException - if the position is outside the bounds of the CuboidClipboardpublic Vector getSize()
@Deprecated public void saveSchematic(File path) throws IOException, DataException
path - IOExceptionDataException@Deprecated public static CuboidClipboard loadSchematic(File path) throws DataException, IOException
path - DataExceptionIOExceptionpublic Vector getOrigin()
public void setOrigin(Vector origin)
origin - the origin to setpublic Vector getOffset()
public void setOffset(Vector offset)
offset - public List<Countable<Integer>> getBlockDistribution()
Copyright © 2010-2014. All Rights Reserved.