Class DiskOptimizedClipboard
- All Implemented Interfaces:
Clipboard
,Extent
,InputExtent
,OutputExtent
,Closeable
,Flushable
,AutoCloseable
,Iterable<BlockVector3>
-
Field Summary
Fields inherited from class com.fastasyncworldedit.core.extent.clipboard.LinearClipboard
entities
Fields inherited from class com.fastasyncworldedit.core.extent.clipboard.SimpleClipboard
offset
-
Constructor Summary
ConstructorDescriptionDiskOptimizedClipboard
(BlockVector3 dimensions) DiskOptimizedClipboard
(BlockVector3 dimensions, File file) DiskOptimizedClipboard
(Region region, UUID uuid) DiskOptimizedClipboard
(File file) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the clipboard.createEntity
(Location location, BaseEntity entity) Create an entity at the given location.void
flush()
Flush the clipboard if appropriate.getBiome
(int index) getBiome
(BlockVector3 position) Get the biome at the given location.int
getBiomeIndex
(int x, int y, int z) getBiomeType
(int x, int y, int z) getBlock
(int index) getBlock
(int x, int y, int z) Get a list of all entities.getEntities
(Region region) Get a list of all entities within the given region.getFile()
getFullBlock
(int i) getFullBlock
(int x, int y, int z) int
getIndex
(int x, int y, int z) getURI()
boolean
Returns true if the clipboard has biome data.void
removeEntity
(int x, int y, int z, UUID uuid) Create an entity at the given location.void
removeEntity
(Entity entity) Remove entity from clipboard.boolean
void
boolean
setBiome
(BlockVector3 position, BiomeType biome) Set the biome.<B extends BlockStateHolder<B>>
booleansetBlock
(int x, int y, int z, B block) <B extends BlockStateHolder<B>>
booleansetBlock
(int i, B block) protected void
setOffset
(BlockVector3 offset) void
setOrigin
(BlockVector3 origin) Set the origin point from which the copy was made from.boolean
setTile
(int x, int y, int z, CompoundTag tag) void
streamBiomes
(IntValueReader task) The locations provided are relative to the clipboard minMethods inherited from class com.fastasyncworldedit.core.extent.clipboard.LinearClipboard
finalize, iterator, iterator
Methods inherited from class com.fastasyncworldedit.core.extent.clipboard.SimpleClipboard
getArea, getDimensions, getHeight, getLength, getMaximumPoint, getMinimumPoint, getOrigin, getRegion, getVolume, getWidth
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.sk89q.worldedit.extent.clipboard.Clipboard
apply, iterator2d, paste, paste, paste, paste, paste, paste, save, save
Methods inherited from interface com.sk89q.worldedit.extent.Extent
addCaves, addOre, addOres, addPostProcessor, addProcessor, addSchems, apply, cancel, center, commit, contains, contains, countBlocks, countBlocks, disableHistory, disableQueue, enableHistory, enableQueue, generate, getBlockDistribution, getBlockDistributionWithData, getHighestTerrainBlock, getHighestTerrainBlock, getMaxY, getMinY, getNearestSurfaceLayer, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, isQueueEnabled, isWorld, lazyCopy, regenerateChunk, relight, relightBlock, relightSky, replaceBlocks, replaceBlocks, replaceBlocks, setBlocks, setBlocks, setBlocks, spawnResource
Methods inherited from interface com.sk89q.worldedit.extent.InputExtent
getBiome, getBlock, getBrightness, getBrightness, getEmittedLight, getEmittedLight, 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, setBlock, setBlockLight, setBlockLight, setHeightMap, setSkyLight, setSkyLight
-
Constructor Details
-
DiskOptimizedClipboard
-
DiskOptimizedClipboard
-
DiskOptimizedClipboard
-
DiskOptimizedClipboard
-
-
Method Details
-
getURI
-
getFile
-
hasBiomes
public boolean hasBiomes()Description copied from interface:Clipboard
Returns true if the clipboard has biome data. This can be checked sinceInputExtent.getBiome(BlockVector2)
strongly suggests returningBiomeTypes.OCEAN
instead ofnull
if biomes aren't present. However, it might not be desired to set areas to ocean if the clipboard is defaulting to ocean, instead of having biomes explicitly set.- Returns:
- true if the clipboard has biome data set
-
setBiome
Description copied from interface:OutputExtent
Set the biome.As implementation varies per Minecraft version, this may set more than this position's biome. On versions prior to 1.15, this will set the entire column. On later versions it will set the 4x4x4 cube.
- Parameters:
position
- the (x, y, z) location to set the biome atbiome
- the biome to set to- Returns:
- true if the biome was successfully set (return value may not be accurate)
-
setBiome
-
setBiome
- Specified by:
setBiome
in classLinearClipboard
-
getBiome
- Specified by:
getBiome
in classLinearClipboard
-
streamBiomes
Description copied from class:LinearClipboard
The locations provided are relative to the clipboard min- Specified by:
streamBiomes
in classLinearClipboard
-
getBiomeType
-
getBiome
Description copied from interface:InputExtent
Get the biome at the given location.If there is no biome available, then the ocean biome should be returned.
As implementation varies per Minecraft version, this may not exactly get this positions biome. On versions prior to 1.15, this will get the entire column. On later versions it will get the 4x4x4 cube's biome.
- Parameters:
position
- the (x, y, z) location to check the biome at- Returns:
- the biome at the location
- See Also:
-
toClipboard
-
setOrigin
Description copied from interface:Clipboard
Set the origin point from which the copy was made from.- Specified by:
setOrigin
in interfaceClipboard
- Overrides:
setOrigin
in classSimpleClipboard
- Parameters:
origin
- the origin
-
setOffset
- Overrides:
setOffset
in classSimpleClipboard
-
flush
public void flush()Description copied from interface:Clipboard
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. -
close
public void close()Description copied from interface:Clipboard
Close the clipboard. May not allow further reading of the clipboard if saved on disk. -
getTileEntities
- Specified by:
getTileEntities
in classLinearClipboard
-
getIndex
public int getIndex(int x, int y, int z) -
getBiomeIndex
public int getBiomeIndex(int x, int y, int z) -
getFullBlock
-
getFullBlock
- Specified by:
getFullBlock
in classLinearClipboard
-
getBlock
- Specified by:
getBlock
in classLinearClipboard
-
getBlock
-
setTile
-
setBlock
-
setBlock
- Specified by:
setBlock
in classLinearClipboard
-
createEntity
Description copied from interface:Extent
Create an entity at the given location.- Parameters:
location
- the locationentity
- the entity- Returns:
- a reference to the created entity, or null if the entity could not be created
-
getEntities
Description copied from interface:Extent
Get a list of all entities.If the extent is not wholly loaded (i.e. a world being simulated in the game will not have every chunk loaded), then this list may not be incomplete.
- Returns:
- a list of entities
-
getEntities
Description copied from interface:Extent
Get a list of all entities within the given region.If the extent is not wholly loaded (i.e. a world being simulated in the game will not have every chunk loaded), then this list may not be incomplete.
- Parameters:
region
- the region in which entities must be contained- Returns:
- a list of entities
-
removeEntity
Description copied from interface:Clipboard
Remove entity from clipboard. -
removeEntity
Description copied from interface:Extent
Create an entity at the given location.- Specified by:
removeEntity
in interfaceExtent
- Overrides:
removeEntity
in classLinearClipboard
- Parameters:
x
- the x coordinatey
- the y coordinatez
- the z coordinateuuid
- the unique identifier of the entity
-