Class BlockManager
java.lang.Object
net.minestom.server.instance.block.BlockManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@Nullable BlockPlacementRule
getBlockPlacementRule
(@NotNull Block block) Gets theBlockPlacementRule
of the specific block.@Nullable BlockHandler
getHandler
(@NotNull String namespace) @NotNull BlockHandler
getHandlerOrDummy
(@NotNull String namespace) void
registerBlockPlacementRule
(@NotNull BlockPlacementRule blockPlacementRule) Registers aBlockPlacementRule
.void
registerHandler
(@NotNull String namespace, @NotNull Supplier<@NotNull BlockHandler> handlerSupplier) void
registerHandler
(@NotNull NamespaceID namespace, @NotNull Supplier<@NotNull BlockHandler> handlerSupplier)
-
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
-
getHandlerOrDummy
@Internal @NotNull public @NotNull BlockHandler getHandlerOrDummy(@NotNull @NotNull String namespace) -
registerBlockPlacementRule
Registers aBlockPlacementRule
.- Parameters:
blockPlacementRule
- the block placement rule to register- Throws:
IllegalArgumentException
- ifblockPlacementRule
block id is negative
-
getBlockPlacementRule
Gets theBlockPlacementRule
of the specific block.- Parameters:
block
- the block to check- Returns:
- the block placement rule associated with the block, null if not any
-