Class AbsoluteBlockBatch
java.lang.Object
net.minestom.server.instance.batch.AbsoluteBlockBatch
- All Implemented Interfaces:
Batch<Consumer<AbsoluteBlockBatch>>, Block.Setter
A
Batch which can be used when changes are required across chunk borders,
but the changes do not need any translation. If translation is required,
use a RelativeBlockBatch instead.
Coordinates are relative to the world origin.
- See Also:
-
Field Summary
FieldsFields inherited from interface Batch
BLOCK_BATCH_POOL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(Instance instance, @Nullable Consumer<@UnknownNullability AbsoluteBlockBatch> callback) Applies this batch to the given instance.protected @UnknownNullability AbsoluteBlockBatchapply(Instance instance, @Nullable Consumer<@UnknownNullability AbsoluteBlockBatch> callback, boolean safeCallback) Applies this batch to the given instance, and execute the callback depending on safeCallback.voidBlocks the current thread until the batch is ready to be applied.voidclear()Removes all block data from this batch.booleanisReady()Gets if the batch is ready to be applied to an instance.voidvoidsetInverseOption(BatchOption inverseOption) unsafeApply(Instance instance, @Nullable Consumer<@UnknownNullability AbsoluteBlockBatch> callback) Applies this batch to the given instance, and execute the callback immediately when the blocks have been applied, in an unknown thread.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Block.Setter
setBlock, setBlockArea
-
Field Details
-
readyLatch
-
-
Constructor Details
-
AbsoluteBlockBatch
public AbsoluteBlockBatch() -
AbsoluteBlockBatch
-
-
Method Details
-
setBlock
- Specified by:
setBlockin interfaceBlock.Setter
-
clear
public void clear()Description copied from interface:BatchRemoves all block data from this batch.- Specified by:
clearin interfaceBatch<Consumer<AbsoluteBlockBatch>>
-
isReady
public boolean isReady()Description copied from interface:BatchGets if the batch is ready to be applied to an instance.- Specified by:
isReadyin interfaceBatch<Consumer<AbsoluteBlockBatch>>- Returns:
- true if the batch is ready to apply
-
awaitReady
public void awaitReady()Description copied from interface:BatchBlocks the current thread until the batch is ready to be applied.- Specified by:
awaitReadyin interfaceBatch<Consumer<AbsoluteBlockBatch>>- See Also:
-
apply
public @UnknownNullability AbsoluteBlockBatch apply(Instance instance, @Nullable @Nullable Consumer<@UnknownNullability AbsoluteBlockBatch> callback) Applies this batch to the given instance.- Specified by:
applyin interfaceBatch<Consumer<AbsoluteBlockBatch>>- Parameters:
instance- The instance in which the batch should be appliedcallback- The callback to be executed when the batch is applied- Returns:
- The inverse of this batch, if inverse is enabled in the
BatchOption
-
unsafeApply
public @UnknownNullability AbsoluteBlockBatch unsafeApply(Instance instance, @Nullable @Nullable Consumer<@UnknownNullability AbsoluteBlockBatch> callback) Applies this batch to the given instance, and execute the callback immediately when the blocks have been applied, in an unknown thread.- Parameters:
instance- The instance in which the batch should be appliedcallback- The callback to be executed when the batch is applied- Returns:
- The inverse of this batch, if inverse is enabled in the
BatchOption
-
apply
protected @UnknownNullability AbsoluteBlockBatch apply(Instance instance, @Nullable @Nullable Consumer<@UnknownNullability AbsoluteBlockBatch> callback, boolean safeCallback) Applies this batch to the given instance, and execute the callback depending on safeCallback.- Parameters:
instance- The instance in which the batch should be appliedcallback- The callback to be executed when the batch is appliedsafeCallback- If true, the callback will be executed in the next instance update. Otherwise it will be executed immediately upon completion- Returns:
- The inverse of this batch, if inverse is enabled in the
BatchOption
-
getInverseOption
-
setInverseOption
-