Class BlockBatch
java.lang.Object
net.minestom.server.instance.batch.BlockBatch
- All Implemented Interfaces:
InstanceBatch
,BlockModifier
public class BlockBatch extends java.lang.Object implements InstanceBatch
Used when the blocks you want to place need to be divided in multiple chunks,
use a
ChunkBatch
instead otherwise.
Can be created using Instance.createBlockBatch()
.- See Also:
InstanceBatch
-
Field Summary
-
Constructor Summary
Constructors Constructor Description BlockBatch(InstanceContainer instance)
-
Method Summary
Modifier and Type Method Description void
flush(java.lang.Runnable callback)
void
setBlockStateId(int x, int y, int z, short blockStateId, Data data)
Sets a block at a position.void
setCustomBlock(int x, int y, int z, short customBlockId, Data data)
Sets aCustomBlock
at a position.void
setSeparateBlocks(int x, int y, int z, short blockStateId, short customBlockId, Data data)
Sets aCustomBlock
at a position with a custom state id.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minestom.server.instance.BlockModifier
setBlock, setBlock, setBlockStateId, setBlockStateId, setCustomBlock, setCustomBlock, setCustomBlock, setCustomBlock, setSeparateBlocks, setSeparateBlocks
-
Constructor Details
-
Method Details
-
setBlockStateId
Description copied from interface:BlockModifier
Sets a block at a position.You can use
BlockModifier.setBlock(int, int, int, Block)
if you want it to be more explicit.- Specified by:
setBlockStateId
in interfaceBlockModifier
- Parameters:
x
- the block Xy
- the block Yz
- the block ZblockStateId
- the block state iddata
- the blockData
, can be null
-
setCustomBlock
Description copied from interface:BlockModifier
Sets aCustomBlock
at a position.The custom block id should be the one returned by
CustomBlock.getCustomBlockId()
.- Specified by:
setCustomBlock
in interfaceBlockModifier
- Parameters:
x
- the block Xy
- the block Yz
- the block ZcustomBlockId
- the custom block iddata
- the blockData
, can be null
-
setSeparateBlocks
public void setSeparateBlocks(int x, int y, int z, short blockStateId, short customBlockId, Data data)Description copied from interface:BlockModifier
Sets aCustomBlock
at a position with a custom state id.The custom block id should be the one returned by
CustomBlock.getCustomBlockId()
, and the block state id can be anything you want, state id can be retrieved usingBlock.getBlockId()
.- Specified by:
setSeparateBlocks
in interfaceBlockModifier
- Parameters:
x
- the block Xy
- the block Yz
- the block ZblockStateId
- the block state idcustomBlockId
- the custom block iddata
- the blockData
, can be null
-
flush
public void flush(java.lang.Runnable callback)
-