Class BlockPlacementRule
java.lang.Object
net.minestom.server.instance.block.rule.BlockPlacementRule
- Direct Known Subclasses:
AxisPlacementRule
,RedstonePlacementRule
,StairsPlacementRule
,WallPlacementRule
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract @Nullable Block
blockPlace
(@NotNull Instance instance, @NotNull Block block, @NotNull BlockFace blockFace, @NotNull Point blockPosition, @NotNull Player pl) Called when the block is placed.abstract @NotNull Block
blockUpdate
(@NotNull Instance instance, @NotNull Point blockPosition, @NotNull Block currentBlock) Called when the block state id can be updated (for instance if a neighbour block changed).@NotNull Block
getBlock()
-
Constructor Details
-
BlockPlacementRule
-
-
Method Details
-
blockUpdate
@NotNull public abstract @NotNull Block blockUpdate(@NotNull @NotNull Instance instance, @NotNull @NotNull Point blockPosition, @NotNull @NotNull Block currentBlock) Called when the block state id can be updated (for instance if a neighbour block changed).- Parameters:
instance
- the instance of the blockblockPosition
- the block positioncurrentBlock
- the current block- Returns:
- the updated block
-
blockPlace
@Nullable public abstract @Nullable Block blockPlace(@NotNull @NotNull Instance instance, @NotNull @NotNull Block block, @NotNull @NotNull BlockFace blockFace, @NotNull @NotNull Point blockPosition, @NotNull @NotNull Player pl) Called when the block is placed.- Parameters:
instance
- the instance of the blockblock
- the block placedblockFace
- the block faceblockPosition
- the block positionpl
- the player who placed the block- Returns:
- the block to place,
null
to cancel
-
getBlock
-