Interface IQueueExtent<T extends IChunk>
- All Superinterfaces:
Extent,Flushable,IBatchProcessor,IBatchProcessorHolder,IChunkExtent<T>,InputExtent,OutputExtent,Trimable
- All Known Implementing Classes:
SingleThreadQueueExtent
public interface IQueueExtent<T extends IChunk>
extends Flushable, Trimable, IChunkExtent<T>, IBatchProcessorHolder
TODO: implement Extent (need to refactor Extent first) Interface for a queue based extent which
uses chunks
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.fastasyncworldedit.core.queue.IChunkExtent
IChunkExtent.IChunkEntity -
Method Summary
Modifier and TypeMethodDescriptiondefault ChunkFilterBlockapply(ChunkFilterBlock block, Filter filter, Region region, int chunkX, int chunkZ, boolean full) default <T extends Filter>
Tdefault Operationcommit()Return anOperationthat should be called to tie up loose ends (such as to commit changes in a buffer).create(boolean isFull) Create a new root IChunk object.A filter block is used to iterate over blocks / positions.voidMust ensure it is not in the queue handler (i.e.voidMust ensure that it is enqueued with QueueHandlervoidflush()Flush all changes to the world.getCachedGet(int chunkX, int chunkZ) Get the cached get object.getCachedSet(int chunkX, int chunkZ) Get the cached chunk set object.default BlockVector3Get the maximum point in the extent.default BlockVector3Get the minimum point in the extent.Get the side effects to be used with this extentvoidinit(Extent extent, IChunkCache<IChunkGet> get, IChunkCache<IChunkSet> set) Initialize the queue (for reusability)booleanisEmpty()booleandefault booleanvoidsetFastMode(boolean fastMode) voidsetSideEffectSet(SideEffectSet sideEffectSet) Set the side effects to be used with this extentintsize()Returns the number of chunks in this queue.<V extends Future<V>>
VSubmit the chunk so that its changes are applied to the world<V extends Future<V>>
VsubmitTaskUnchecked(Callable<V> callable) Submit a task to the extent to be queued as if it were a chunkdefault TWrap the chunk object (i.e., for region restrictions / limits etc.).Methods inherited from interface com.sk89q.worldedit.extent.Extent
addCaves, addOre, addOres, addPostProcessor, addProcessor, addSchems, apply, cancel, center, contains, contains, countBlocks, countBlocks, disableHistory, enableHistory, generate, getBlockDistribution, getBlockDistributionWithData, getEntities, getEntities, getHighestTerrainBlock, getHighestTerrainBlock, getMaxY, getMinY, getNearestSurfaceLayer, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, isWorld, lazyCopy, regenerateChunk, relight, relightBlock, relightSky, replaceBlocks, replaceBlocks, replaceBlocks, setBlocks, setBlocks, setBlocks, spawnResourceMethods inherited from interface com.fastasyncworldedit.core.queue.IBatchProcessor
getScope, processGet, trimNBT, trimNBT, trimYMethods inherited from interface com.fastasyncworldedit.core.extent.processor.IBatchProcessorHolder
construct, getPostProcessor, getProcessor, join, joinPost, postProcess, postProcessSet, processGet, processSet, remove, setPostProcessor, setProcessorMethods inherited from interface com.fastasyncworldedit.core.queue.IChunkExtent
createEntity, createEntity, getBiome, getBiomeType, getBlock, getBrightness, getEmittedLight, getFullBlock, getOpacity, getOrCreateChunk, getSkyLight, removeEntity, setBiome, setBiome, setBlock, setBlockLight, setSkyLight, tileMethods inherited from interface com.sk89q.worldedit.extent.InputExtent
getBiome, getBlock, getBrightness, getEmittedLight, getFullBlock, getHeightMap, getOpacity, getSkyLightMethods inherited from interface com.sk89q.worldedit.extent.OutputExtent
fullySupports3DBiomes, setBiome, setBlock, setBlockLight, setHeightMap, setSkyLight, setTile
-
Method Details
-
isQueueEnabled
default boolean isQueueEnabled()- Specified by:
isQueueEnabledin interfaceExtent
-
enableQueue
void enableQueue()Must ensure that it is enqueued with QueueHandler- Specified by:
enableQueuein interfaceExtent
-
disableQueue
void disableQueue()Must ensure it is not in the queue handler (i.e. does not change blocks in the world)- Specified by:
disableQueuein interfaceExtent
-
init
Initialize the queue (for reusability)- Parameters:
extent- extent to useget- cache of chunk GETset- cache of chunk SET
-
getCachedGet
Get the cached get object. This is faster than getting the object using NMS and allows for wrapping. -
getCachedSet
Get the cached chunk set object. -
submit
Submit the chunk so that its changes are applied to the world- Returns:
- Future
-
getMinimumPoint
Description copied from interface:ExtentGet the minimum point in the extent.If the extent is unbounded, then a large (negative) value may be returned.
- Specified by:
getMinimumPointin interfaceExtent- Returns:
- the minimum point
-
getMaximumPoint
Description copied from interface:ExtentGet the maximum point in the extent.If the extent is unbounded, then a large (positive) value may be returned.
- Specified by:
getMaximumPointin interfaceExtent- Returns:
- the maximum point
-
setFastMode
void setFastMode(boolean fastMode) -
isFastMode
boolean isFastMode() -
setSideEffectSet
Set the side effects to be used with this extent- Since:
- 2.12.3
-
getSideEffectSet
SideEffectSet getSideEffectSet()Get the side effects to be used with this extent- Since:
- 2.12.3
-
submitTaskUnchecked
Submit a task to the extent to be queued as if it were a chunk -
create
Create a new root IChunk object. Full chunks will be reused, so a more optimized chunk can be returned in that case.- Parameters:
isFull- true if a more optimized chunk should be returned- Returns:
- a more optimized chunk object
- See Also:
-
wrap
Wrap the chunk object (i.e., for region restrictions / limits etc.).- Returns:
- wrapped chunk
-
commit
Description copied from interface:OutputExtentReturn anOperationthat should be called to tie up loose ends (such as to commit changes in a buffer).- Specified by:
commitin interfaceExtent- Specified by:
commitin interfaceOutputExtent- Returns:
- an operation or null if there is none to execute
-
flush
void flush()Flush all changes to the world. Best to call this async, so it doesn't hang the server.- Specified by:
flushin interfaceFlushable- Specified by:
flushin interfaceIBatchProcessor
-
createFilterBlock
ChunkFilterBlock createFilterBlock()A filter block is used to iterate over blocks / positions. Essentially combines BlockVector3, Extent and BlockState functions in a way that avoids lookups. -
size
int size()Returns the number of chunks in this queue.- Returns:
- the number of chunks in this queue
-
isEmpty
boolean isEmpty()- Returns:
trueif this queue contains no elements
-
apply
default ChunkFilterBlock apply(@Nullable ChunkFilterBlock block, Filter filter, Region region, int chunkX, int chunkZ, boolean full) -
apply
-