Class AbstractChangeSet
java.lang.Object
com.fastasyncworldedit.core.history.changeset.AbstractChangeSet
- All Implemented Interfaces:
IBatchProcessor
,ChangeSet
,Closeable
,AutoCloseable
- Direct Known Subclasses:
AbstractDelegateChangeSet
,FaweStreamChangeSet
,NullChangeSet
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected AtomicInteger
protected AtomicInteger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
add
(int x, int y, int z, int combinedFrom, int combinedTo) void
void
void
add
(BlockChange change) void
Add the given change to the history.void
add
(EntityCreate change) void
add
(EntityRemove change) void
add
(BlockVector3 loc, BaseBlock from, BaseBlock to) abstract void
addBiomeChange
(int x, int y, int z, BiomeType from, BiomeType to) abstract void
abstract void
abstract void
addTileCreate
(CompoundTag tag) abstract void
addTileRemove
(CompoundTag tag) Future<?>
addWriteTask
(Runnable writeTask) Future<?>
addWriteTask
(Runnable writeTask, boolean completeNow) Get a backward directed iterator that can be used for undo.void
close()
Close the changeset.void
Convert this processor into an Extent based processor instead of a queue batch based on.void
flush()
Get a forward directed iterator that can be used for redo.getIterator
(boolean redo) getIterator
(BlockBag blockBag, int mode, boolean redo) getScope()
Default to CUSTOM ProcessorScope as we want custom processors people add to be before we write history, but after FAWE does it's own stuff.getWorld()
boolean
isEmpty()
Get if the changeset is empty (i.e.void
postProcess
(IChunk chunk, IChunkGet get, IChunkSet set) Post-process a chunk that has been edited.Future<?>
postProcessSet
(IChunk chunk, IChunkGet get, IChunkSet set) Post-process a chunk that has been edited.processSet
(IChunk chunk, IChunkGet get, IChunkSet set) Process a chunk that has been set.toEditSession
(Actor actor) toEditSession
(Actor actor, Region[] regions) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.sk89q.worldedit.history.changeset.ChangeSet
delete, isRecordingChanges, setRecordChanges, size, summarize
Methods inherited from interface com.fastasyncworldedit.core.queue.IBatchProcessor
join, joinPost, processGet, remove, trimNBT, trimY
-
Field Details
-
waitingCombined
-
waitingAsync
-
closed
protected boolean closed
-
-
Constructor Details
-
AbstractChangeSet
-
-
Method Details
-
getWorld
-
closeAsync
public void closeAsync() -
flush
public void flush()- Specified by:
flush
in interfaceIBatchProcessor
-
close
Description copied from interface:ChangeSet
Close the changeset.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceChangeSet
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
add
public abstract void add(int x, int y, int z, int combinedFrom, int combinedTo) -
backwardIterator
Description copied from interface:ChangeSet
Get a backward directed iterator that can be used for undo.The iterator may return the changes out of order, as long as the final result after all changes have been applied is correct.
- Specified by:
backwardIterator
in interfaceChangeSet
- Returns:
- a undo directed iterator
-
forwardIterator
Description copied from interface:ChangeSet
Get a forward directed iterator that can be used for redo.The iterator may return the changes out of order, as long as the final result after all changes have been applied is correct.
- Specified by:
forwardIterator
in interfaceChangeSet
- Returns:
- a forward directed iterator
-
construct
Description copied from interface:IBatchProcessor
Convert this processor into an Extent based processor instead of a queue batch based on.- Specified by:
construct
in interfaceIBatchProcessor
-
processSet
Description copied from interface:IBatchProcessor
Process a chunk that has been set.- Specified by:
processSet
in interfaceIBatchProcessor
-
postProcess
Description copied from interface:IBatchProcessor
Post-process a chunk that has been edited. Set should NOT be modified here, changes will NOT be flushed to the world, but MAY be flushed to history. Defaults to nothing as most Processors will not use it. If the post-processor will run tasks asynchronously/not be blocking, useIBatchProcessor.postProcessSet(com.fastasyncworldedit.core.queue.IChunk, com.fastasyncworldedit.core.queue.IChunkGet, com.fastasyncworldedit.core.queue.IChunkSet)
to return a Future.- Specified by:
postProcess
in interfaceIBatchProcessor
-
postProcessSet
Description copied from interface:IBatchProcessor
Post-process a chunk that has been edited. Set should NOT be modified here, changes will NOT be flushed to the world, but MAY be flushed to history. Defaults to nothing as most Processors will not use it. Post-processors that are not technically blocking should override this method to allow post-processors to become blocking if required.- Specified by:
postProcessSet
in interfaceIBatchProcessor
-
getScope
Description copied from interface:IBatchProcessor
Default to CUSTOM ProcessorScope as we want custom processors people add to be before we write history, but after FAWE does it's own stuff.- Specified by:
getScope
in interfaceIBatchProcessor
-
addTileCreate
-
addTileRemove
-
addEntityRemove
-
addEntityCreate
-
addBiomeChange
-
getIterator
-
getIterator
-
toEditSession
-
toEditSession
-
add
-
add
-
add
Description copied from interface:ChangeSet
Add the given change to the history. -
add
-
isEmpty
public boolean isEmpty()Description copied from interface:ChangeSet
Get if the changeset is empty (i.e. size == 0) -
add
-
add
-
add
-
addWriteTask
-
addWriteTask
-