Class BlockPlacementRule

java.lang.Object
net.minestom.server.instance.block.rule.BlockPlacementRule
Direct Known Subclasses:
AxisPlacementRule, RedstonePlacementRule, StairsPlacementRule, WallPlacementRule

public abstract class BlockPlacementRule extends Object
  • Constructor Details

    • BlockPlacementRule

      public BlockPlacementRule(@NotNull @NotNull Block block)
  • 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 block
      blockPosition - the block position
      currentBlock - 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 block
      block - the block placed
      blockFace - the block face
      blockPosition - the block position
      pl - the player who placed the block
      Returns:
      the block to place, null to cancel
    • getBlock

      @NotNull public @NotNull Block getBlock()