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 voidclose()Close the clipboard.static ClipboardDeprecated.Internal use only.static ClipboardDeprecated.Internal use only.default voidflush()Flush the clipboard if appropriate.default intgetArea()Get the dimensions of the copy, which is at minimum (1, 1, 1).default intdefault intGet the origin point from which the copy was made from.Get the bounding region of this extent.default URIgetURI()default intdefault intgetWidth()default booleanReturns true if the clipboard has biome data.default Iterator<BlockVector3> iterator()default Iterator<BlockVector3> default Iterator<BlockVector2> default voidpaste(Extent extent, BlockVector3 to, boolean pasteAir) default voidpaste(Extent extent, BlockVector3 to, boolean pasteAir, boolean pasteEntities, boolean pasteBiomes) default voidpaste(Extent extent, BlockVector3 to, boolean pasteAir, Transform transform) default EditSessionpaste(World world, BlockVector3 to) default EditSessionpaste(World world, BlockVector3 to, boolean allowUndo, boolean pasteAir, boolean pasteEntities, Transform transform) Paste this schematic in a world.default EditSessionpaste(World world, BlockVector3 to, boolean allowUndo, boolean pasteAir, Transform transform) voidremoveEntity(Entity entity) Remove entity from clipboard.default voidsave(File file, ClipboardFormat format) default voidsave(OutputStream stream, ClipboardFormat format) Save this schematic to a stream.voidsetOrigin(BlockVector3 origin) Set the origin point from which the copy was made from.default ClipboardReturns 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, spawnResourceMethods inherited from interface com.sk89q.worldedit.extent.InputExtent
getBiome, getBiome, getBiomeType, getBlock, getBlock, getBrightness, getBrightness, getEmittedLight, getEmittedLight, getFullBlock, getFullBlock, getHeightMap, getOpacity, getOpacity, getSkyLight, getSkyLightMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods 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 newSimpleClipboardinstance. 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.OCEANinstead ofnullif 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:
iteratorin 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:
closein interfaceAutoCloseable- Specified by:
closein 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)
-