Clipboard
, which is
far more versatile. Transforms are supported using affine
transformations and full entity support is provided because
the clipboard properly implements Extent
. However,
the new clipboard class is only available in WorldEdit 6.x and
beyond. We intend on keeping this deprecated class in WorldEdit
for an extended amount of time so there is no rush to
switch (but new features will not be supported). To copy between
a clipboard and a world (or between any two Extent
s),
one can use ForwardExtentCopy
. See
ClipboardCommands
and SchematicCommands
for
more information.@Deprecated
public class CuboidClipboard
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
CuboidClipboard.FlipDirection
Deprecated.
An enum of possible flip directions.
|
Constructor and Description |
---|
CuboidClipboard(Vector size)
Deprecated.
Constructs the clipboard.
|
CuboidClipboard(Vector size,
Vector origin)
Deprecated.
Constructs the clipboard.
|
CuboidClipboard(Vector size,
Vector origin,
Vector offset)
Deprecated.
Constructs the clipboard.
|
Modifier and Type | Method and Description |
---|---|
void |
copy(EditSession editSession)
Deprecated.
Copies blocks to the clipboard.
|
void |
copy(EditSession editSession,
Region region)
Deprecated.
Copies blocks to the clipboard.
|
void |
flip(CuboidClipboard.FlipDirection dir)
Deprecated.
Flip the clipboard.
|
void |
flip(CuboidClipboard.FlipDirection dir,
boolean aroundPlayer)
Deprecated.
Flip the clipboard.
|
BaseBlock |
getBlock(Vector position)
Deprecated.
Get the block at the given position.
|
java.util.List<Countable<java.lang.Integer>> |
getBlockDistribution()
Deprecated.
Get the block distribution inside a clipboard.
|
java.util.List<Countable<BaseBlock>> |
getBlockDistributionWithData()
Deprecated.
Get the block distribution inside a clipboard with data values.
|
int |
getHeight()
Deprecated.
Get the height (Y-direction) of the clipboard.
|
int |
getLength()
Deprecated.
Get the length (Z-direction) of the clipboard.
|
Vector |
getOffset()
Deprecated.
Get the offset of the player to the clipboard's minimum point
(minimum X, Y, Z coordinates).
|
Vector |
getOrigin()
Deprecated.
Get the origin point, which corresponds to where the copy was
originally copied from.
|
BaseBlock |
getPoint(Vector position)
Deprecated.
use
getBlock(Vector) instead |
Vector |
getSize()
Deprecated.
Get the dimensions of the clipboard.
|
int |
getWidth()
Deprecated.
Get the width (X-direction) of the clipboard.
|
static CuboidClipboard |
loadSchematic(java.io.File path)
Deprecated.
|
void |
paste(EditSession editSession,
Vector newOrigin,
boolean noAir)
Deprecated.
Paste the clipboard at the given location using the given
EditSession . |
void |
paste(EditSession editSession,
Vector newOrigin,
boolean noAir,
boolean entities)
Deprecated.
Paste the clipboard at the given location using the given
EditSession . |
LocalEntity[] |
pasteEntities(Vector newOrigin)
Deprecated.
Paste the stored entities to the given position.
|
void |
place(EditSession editSession,
Vector newOrigin,
boolean noAir)
Deprecated.
Paste the clipboard at the given location using the given
EditSession . |
void |
rotate2D(int angle)
Deprecated.
Rotate the clipboard in 2D.
|
void |
saveSchematic(java.io.File path)
Deprecated.
|
void |
setBlock(Vector position,
BaseBlock block)
Deprecated.
Set the block at a position in the clipboard.
|
void |
setOffset(Vector offset)
Deprecated.
Set the offset of the player to the clipboard's minimum point
(minimum X, Y, Z coordinates).
|
void |
setOrigin(Vector origin)
Deprecated.
Set the origin point, which corresponds to where the copy was
originally copied from.
|
void |
storeEntity(LocalEntity entity)
Deprecated.
Store an entity.
|
public CuboidClipboard(Vector size)
size
- the dimensions of the clipboard (should be at least 1 on every dimension)public CuboidClipboard(Vector size, Vector origin)
size
- the dimensions of the clipboard (should be at least 1 on every dimension)origin
- the origin point where the copy was made, which must be the
CuboidRegion.getMinimumPoint()
relative to the copypublic CuboidClipboard(Vector size, Vector origin, Vector offset)
size
- the dimensions of the clipboard (should be at least 1 on every dimension)origin
- the origin point where the copy was made, which must be the
CuboidRegion.getMinimumPoint()
relative to the copyoffset
- the offset from the minimum point of the copy where the user waspublic 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
EditSession
.
This method blocks the server/game until the entire clipboard is
pasted. In the future, ForwardExtentCopy
will be recommended,
which, if combined with the proposed operation scheduler framework,
will not freeze the game/server.
editSession
- the EditSession to which blocks are to be copied tonewOrigin
- the new origin point (must correspond to the minimum point of the cuboid)noAir
- true to not copy air blocks in the sourceMaxChangedBlocksException
- thrown if too many blocks were changedpublic void paste(EditSession editSession, Vector newOrigin, boolean noAir, boolean entities) throws MaxChangedBlocksException
EditSession
.
This method blocks the server/game until the entire clipboard is
pasted. In the future, ForwardExtentCopy
will be recommended,
which, if combined with the proposed operation scheduler framework,
will not freeze the game/server.
editSession
- the EditSession to which blocks are to be copied tonewOrigin
- the new origin point (must correspond to the minimum point of the cuboid)noAir
- true to not copy air blocks in the sourceentities
- true to copy entitiesMaxChangedBlocksException
- thrown if too many blocks were changedpublic void place(EditSession editSession, Vector newOrigin, boolean noAir) throws MaxChangedBlocksException
EditSession
.
This method blocks the server/game until the entire clipboard is
pasted. In the future, ForwardExtentCopy
will be recommended,
which, if combined with the proposed operation scheduler framework,
will not freeze the game/server.
editSession
- the EditSession to which blocks are to be copied tonewOrigin
- the new origin point (must correspond to the minimum point of the cuboid)noAir
- true to not copy air blocks in the sourceMaxChangedBlocksException
- thrown if too many blocks were changedpublic LocalEntity[] pasteEntities(Vector newOrigin)
newOrigin
- the new originpublic void storeEntity(LocalEntity entity)
entity
- the entity@Deprecated public BaseBlock getPoint(Vector position) throws java.lang.ArrayIndexOutOfBoundsException
getBlock(Vector)
insteadIf the position is out of bounds, air will be returned.
position
- the point, relative to the origin of the copy (0, 0, 0) and not to the actual copy originjava.lang.ArrayIndexOutOfBoundsException
- if the position is outside the bounds of the CuboidClipboardpublic BaseBlock getBlock(Vector position) throws java.lang.ArrayIndexOutOfBoundsException
If the position is out of bounds, air will be returned.
position
- the point, relative to the origin of the copy (0, 0, 0) and not to the actual copy originjava.lang.ArrayIndexOutOfBoundsException
- if the position is outside the bounds of the CuboidClipboardpublic void setBlock(Vector position, BaseBlock block)
position
- the point, relative to the origin of the copy (0, 0, 0) and not to the actual copy origin.block
- the block to setjava.lang.ArrayIndexOutOfBoundsException
- if the position is outside the bounds of the CuboidClipboardpublic Vector getSize()
@Deprecated public void saveSchematic(java.io.File path) throws java.io.IOException, DataException
SchematicFormat.MCEDIT
path
- the path to the file to savejava.io.IOException
- thrown on I/O errorDataException
- thrown on error writing the data for other reasons@Deprecated public static CuboidClipboard loadSchematic(java.io.File path) throws DataException, java.io.IOException
SchematicFormat.MCEDIT
path
- the path to the file to loadjava.io.IOException
- thrown on I/O errorDataException
- thrown on error writing the data for other reasonspublic Vector getOrigin()
public void setOrigin(Vector origin)
origin
- the origin to setpublic Vector getOffset()
The offset is inverse (multiplied by -1).
public void setOffset(Vector offset)
The offset is inverse (multiplied by -1).
offset
- the new offsetpublic java.util.List<Countable<java.lang.Integer>> getBlockDistribution()