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 ChunkFilterBlock
apply
(ChunkFilterBlock block, Filter filter, Region region, int chunkX, int chunkZ, boolean full) default <T extends Filter>
Tdefault Operation
commit()
Return anOperation
that 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.void
Must ensure it is not in the queue handler (i.e.void
Must ensure that it is enqueued with QueueHandlervoid
flush()
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 BlockVector3
Get the maximum point in the extent.default BlockVector3
Get the minimum point in the extent.void
init
(Extent extent, IChunkCache<IChunkGet> get, IChunkCache<IChunkSet> set) Initialize the queue (for reusability)boolean
isEmpty()
boolean
default boolean
void
setFastMode
(boolean fastMode) int
size()
Returns the number of chunks in this queue.<V extends Future<V>>
VSubmit the chunk so that it's changes are applied to the worlddefault T
Wrap 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, spawnResource
Methods inherited from interface com.fastasyncworldedit.core.queue.IBatchProcessor
getScope, trimNBT, trimNBT, trimY
Methods inherited from interface com.fastasyncworldedit.core.extent.processor.IBatchProcessorHolder
construct, getPostProcessor, getProcessor, join, joinPost, postProcess, postProcessSet, processGet, processSet, remove, setPostProcessor, setProcessor
Methods 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, tile
Methods inherited from interface com.sk89q.worldedit.extent.InputExtent
getBiome, getBlock, getBrightness, getEmittedLight, getFullBlock, getHeightMap, getOpacity, getSkyLight
Methods inherited from interface com.sk89q.worldedit.extent.OutputExtent
fullySupports3DBiomes, setBiome, setBlock, setBlockLight, setHeightMap, setSkyLight, setTile
-
Method Details
-
isQueueEnabled
default boolean isQueueEnabled()- Specified by:
isQueueEnabled
in interfaceExtent
-
enableQueue
void enableQueue()Must ensure that it is enqueued with QueueHandler- Specified by:
enableQueue
in interfaceExtent
-
disableQueue
void disableQueue()Must ensure it is not in the queue handler (i.e. does not change blocks in the world)- Specified by:
disableQueue
in 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 it's changes are applied to the world- Returns:
- Future
-
getMinimumPoint
Description copied from interface:Extent
Get the minimum point in the extent.If the extent is unbounded, then a large (negative) value may be returned.
- Specified by:
getMinimumPoint
in interfaceExtent
- Returns:
- the minimum point
-
getMaximumPoint
Description copied from interface:Extent
Get the maximum point in the extent.If the extent is unbounded, then a large (positive) value may be returned.
- Specified by:
getMaximumPoint
in interfaceExtent
- Returns:
- the maximum point
-
setFastMode
void setFastMode(boolean fastMode) -
isFastMode
boolean isFastMode() -
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:OutputExtent
Return anOperation
that should be called to tie up loose ends (such as to commit changes in a buffer).- Specified by:
commit
in interfaceExtent
- Specified by:
commit
in 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:
flush
in interfaceFlushable
- Specified by:
flush
in 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:
true
if this queue contains no elements
-
apply
default ChunkFilterBlock apply(@Nullable ChunkFilterBlock block, Filter filter, Region region, int chunkX, int chunkZ, boolean full) -
apply
-