Class BlockManager

java.lang.Object
net.minestom.server.instance.block.BlockManager

public final class BlockManager extends Object
  • Constructor Details

    • BlockManager

      public BlockManager()
  • Method Details

    • registerHandler

      public void registerHandler(@NotNull @NotNull String namespace, @NotNull @NotNull Supplier<@NotNull BlockHandler> handlerSupplier)
    • registerHandler

      public void registerHandler(@NotNull @NotNull NamespaceID namespace, @NotNull @NotNull Supplier<@NotNull BlockHandler> handlerSupplier)
    • getHandler

      @Nullable public @Nullable BlockHandler getHandler(@NotNull @NotNull String namespace)
    • getHandlerOrDummy

      @Internal @NotNull public @NotNull BlockHandler getHandlerOrDummy(@NotNull @NotNull String namespace)
    • registerBlockPlacementRule

      public void registerBlockPlacementRule(@NotNull @NotNull BlockPlacementRule blockPlacementRule)
      Registers a BlockPlacementRule.
      Parameters:
      blockPlacementRule - the block placement rule to register
      Throws:
      IllegalArgumentException - if blockPlacementRule block id is negative
    • getBlockPlacementRule

      @Nullable public @Nullable BlockPlacementRule getBlockPlacementRule(@NotNull @NotNull Block block)
      Gets the BlockPlacementRule of the specific block.
      Parameters:
      block - the block to check
      Returns:
      the block placement rule associated with the block, null if not any