Package net.minestom.server.instance
Interface BlockModifier
- All Known Subinterfaces:
InstanceBatch
- All Known Implementing Classes:
BlockBatch
,ChunkBatch
,Instance
,InstanceContainer
,SharedInstance
public interface BlockModifier
Represents an element which can place blocks at position.
Notably used by Instance
, BlockBatch
and ChunkBatch
.
-
Field Summary
Fields Modifier and Type Field Description static BlockManager
BLOCK_MANAGER
-
Method Summary
Modifier and Type Method Description default void
setBlock(int x, int y, int z, Block block)
default void
setBlock(BlockPosition blockPosition, Block block)
default void
setBlockStateId(int x, int y, int z, short blockStateId)
void
setBlockStateId(int x, int y, int z, short blockStateId, Data data)
Sets a block at a position.default void
setBlockStateId(BlockPosition blockPosition, short blockStateId)
default void
setCustomBlock(int x, int y, int z, short customBlockId)
void
setCustomBlock(int x, int y, int z, short customBlockId, Data data)
Sets aCustomBlock
at a position.default void
setCustomBlock(int x, int y, int z, java.lang.String customBlockId)
default void
setCustomBlock(int x, int y, int z, java.lang.String customBlockId, Data data)
default void
setCustomBlock(BlockPosition blockPosition, java.lang.String customBlockId)
default void
setSeparateBlocks(int x, int y, int z, short blockStateId, short customBlockId)
void
setSeparateBlocks(int x, int y, int z, short blockStateId, short customBlockId, Data data)
Sets aCustomBlock
at a position with a custom state id.default void
setSeparateBlocks(BlockPosition blockPosition, short blockStateId, short customBlockId)
-
Field Details
-
Method Details
-
setBlockStateId
Sets a block at a position.You can use
setBlock(int, int, int, Block)
if you want it to be more explicit.- Parameters:
x
- the block Xy
- the block Yz
- the block ZblockStateId
- the block state iddata
- the blockData
, can be null
-
setCustomBlock
Sets aCustomBlock
at a position.The custom block id should be the one returned by
CustomBlock.getCustomBlockId()
.- Parameters:
x
- the block Xy
- the block Yz
- the block ZcustomBlockId
- the custom block iddata
- the blockData
, can be null
-
setSeparateBlocks
void setSeparateBlocks(int x, int y, int z, short blockStateId, short customBlockId, @Nullable Data data)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()
.- Parameters:
x
- the block Xy
- the block Yz
- the block ZblockStateId
- the block state idcustomBlockId
- the custom block iddata
- the blockData
, can be null
-
setBlockStateId
default void setBlockStateId(int x, int y, int z, short blockStateId) -
setBlock
-
setBlock
-
setBlockStateId
-
setCustomBlock
default void setCustomBlock(int x, int y, int z, short customBlockId) -
setCustomBlock
default void setCustomBlock(int x, int y, int z, @NotNull java.lang.String customBlockId, @Nullable Data data) -
setCustomBlock
default void setCustomBlock(int x, int y, int z, @NotNull java.lang.String customBlockId) -
setCustomBlock
default void setCustomBlock(@NotNull BlockPosition blockPosition, @NotNull java.lang.String customBlockId) -
setSeparateBlocks
default void setSeparateBlocks(int x, int y, int z, short blockStateId, short customBlockId) -
setSeparateBlocks
default void setSeparateBlocks(@NotNull BlockPosition blockPosition, short blockStateId, short customBlockId)
-