public interface Batch
Magic will process pending BlockBatch requests once every tick, up to a maximum number of Block updates per tick (the default is 1,000).
Every BlockBatch is required to perform only as many updates as requested, and to report how many updates were performed.
A BlockBatch must also report when it is finished, and perform any required actions on finish, such as registering an UndoBatch for undo.
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Finish this batch and force-cancel any outstanding effects.
|
void |
finish()
Immediately finish this batch.
|
String |
getName()
Return a friendly name to identify this batch.
|
boolean |
isFinished()
Whether or not this batch is finished
|
int |
process(int maxBlocks)
Process one iteration of this batch.
|
int |
remaining()
The remaining size of this batch.
|
int |
size()
The size of this batch.
|
int process(int maxBlocks)
maxBlocks - The maximum number of blocks the batch should processboolean isFinished()
void finish()
This may cancel any remaining operations, but should clean up, add to undo queues, etc, whatever has been done so far.
void cancel()
int size()
Can be used in conjunction with remaining() for a progress indicator.
int remaining()
Can be used in conjunction with size() for a progress indicator.
String getName()
Copyright © 2021 elMakers. All rights reserved.