Interface Clipboard
- All Superinterfaces:
AutoCloseable
,Closeable
,Extent
,Flushable
,InputExtent
,Iterable<BlockVector3>
,OutputExtent
- All Known Implementing Classes:
BlockArrayClipboard
,CPUOptimizedClipboard
,DiskOptimizedClipboard
,EmptyClipboard
,LinearClipboard
,MemoryOptimizedClipboard
,ReadOnlyClipboard
,SimpleClipboard
,WorldCopyClipboard
Specifies an object that implements something suitable as a "clipboard."
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T extends Filter>
Tdefault void
close()
Close the clipboard.static Clipboard
Deprecated.Internal use only.static Clipboard
Deprecated.Internal use only.default void
flush()
Flush the clipboard if appropriate.default int
getArea()
Get the dimensions of the copy, which is at minimum (1, 1, 1).default int
default int
Get the origin point from which the copy was made from.Get the bounding region of this extent.default URI
getURI()
default int
default int
getWidth()
default boolean
Returns true if the clipboard has biome data.default Iterator
<BlockVector3> iterator()
default Iterator
<BlockVector3> default Iterator
<BlockVector2> default void
paste
(Extent extent, BlockVector3 to, boolean pasteAir) default void
paste
(Extent extent, BlockVector3 to, boolean pasteAir, boolean pasteEntities, boolean pasteBiomes) default void
paste
(Extent extent, BlockVector3 to, boolean pasteAir, Transform transform) default EditSession
paste
(World world, BlockVector3 to) default EditSession
paste
(World world, BlockVector3 to, boolean allowUndo, boolean pasteAir, boolean pasteEntities, Transform transform) Paste this schematic in a world.default EditSession
paste
(World world, BlockVector3 to, boolean allowUndo, boolean pasteAir, Transform transform) void
removeEntity
(Entity entity) Remove entity from clipboard.default void
save
(File file, ClipboardFormat format) default void
save
(OutputStream stream, ClipboardFormat format) Save this schematic to a stream.void
setOrigin
(BlockVector3 origin) Set the origin point from which the copy was made from.default Clipboard
Returns a clipboard with a given transform baked in.Methods inherited from interface com.sk89q.worldedit.extent.Extent
addCaves, addOre, addOres, addPostProcessor, addProcessor, addSchems, apply, cancel, center, commit, contains, contains, countBlocks, countBlocks, createEntity, createEntity, disableHistory, disableQueue, enableHistory, enableQueue, generate, getBlockDistribution, getBlockDistributionWithData, getEntities, getEntities, getHighestTerrainBlock, getHighestTerrainBlock, getMaximumPoint, getMaxY, getMinimumPoint, getMinY, getNearestSurfaceLayer, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, isQueueEnabled, isWorld, lazyCopy, regenerateChunk, relight, relightBlock, relightSky, removeEntity, replaceBlocks, replaceBlocks, replaceBlocks, setBlocks, setBlocks, setBlocks, spawnResource
Methods inherited from interface com.sk89q.worldedit.extent.InputExtent
getBiome, getBiome, getBiomeType, getBlock, getBlock, getBrightness, getBrightness, getEmittedLight, getEmittedLight, getFullBlock, getFullBlock, getHeightMap, getOpacity, getOpacity, getSkyLight, getSkyLight
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface com.sk89q.worldedit.extent.OutputExtent
fullySupports3DBiomes, setBiome, setBiome, setBiome, setBlock, setBlock, setBlockLight, setBlockLight, setHeightMap, setSkyLight, setSkyLight, setTile, tile
-
Method Details
-
create
Deprecated.Internal use only. UseBlockArrayClipboard(Region)
Creates a newReadOnlyClipboard
. -
create
Deprecated.Internal use only. UseBlockArrayClipboard(Region, UUID)
Create a newSimpleClipboard
instance. Will be one of the following, depending on settings: -DiskOptimizedClipboard
-CPUOptimizedClipboard
-MemoryOptimizedClipboard
-
getRegion
Region getRegion()Get the bounding region of this extent.Implementations should return a copy of the region.
- Returns:
- the bounding region
-
getDimensions
BlockVector3 getDimensions()Get the dimensions of the copy, which is at minimum (1, 1, 1).- Returns:
- the dimensions
-
getOrigin
BlockVector3 getOrigin()Get the origin point from which the copy was made from.- Returns:
- the origin
-
setOrigin
Set the origin point from which the copy was made from.- Parameters:
origin
- the origin
-
hasBiomes
default boolean hasBiomes()Returns true if the clipboard has biome data. This can be checked sinceInputExtent.getBiome(BlockVector3)
strongly suggests returningBiomeTypes.OCEAN
instead ofnull
if biomes aren't present.- Returns:
- true if the clipboard has biome data set
-
transform
Returns a clipboard with a given transform baked in.Note: This method may return the same clipboard object, if a copy is needed then you should check the returned value for identity equality and copy if needed.
- Parameters:
transform
- The transform- Returns:
- The new clipboard
- Throws:
WorldEditException
- if the copy encounters an error
-
removeEntity
Remove entity from clipboard. -
getWidth
default int getWidth() -
getHeight
default int getHeight() -
getLength
default int getLength() -
getArea
default int getArea() -
getVolume
default int getVolume() -
iterator
-
iterator
- Specified by:
iterator
in interfaceIterable<BlockVector3>
-
iterator2d
-
getURI
-
apply
-
close
default void close()Close the clipboard. May not allow further reading of the clipboard if saved on disk.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
flush
default void flush()Flush the clipboard if appropriate. Only does something if using clipboard-on-disk. Blocking method and ensures all data is saved to disk for any further operation with the clipboard. -
paste
-
save
- Throws:
IOException
-
save
Save this schematic to a stream.- Throws:
IOException
-
paste
default EditSession paste(World world, BlockVector3 to, boolean allowUndo, boolean pasteAir, @Nullable Transform transform) -
paste
default EditSession paste(World world, BlockVector3 to, boolean allowUndo, boolean pasteAir, boolean pasteEntities, @Nullable Transform transform) Paste this schematic in a world. -
paste
-
paste
-
paste
default void paste(Extent extent, BlockVector3 to, boolean pasteAir, boolean pasteEntities, boolean pasteBiomes)
-