Class BlockManager
java.lang.Object
net.minestom.server.instance.block.BlockManager
public class BlockManager
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description BlockManager()
-
Method Summary
Modifier and Type Method Description BlockPlacementRule
getBlockPlacementRule(short blockStateId)
Gets theBlockPlacementRule
of the specific block.BlockPlacementRule
getBlockPlacementRule(Block block)
Gets theBlockPlacementRule
of the specific block.CustomBlock
getCustomBlock(short id)
Gets theCustomBlock
with the specific custom block idCustomBlock.getCustomBlockId()
.CustomBlock
getCustomBlock(java.lang.String identifier)
Gets theCustomBlock
with the specific identifierCustomBlock.getIdentifier()
.void
registerBlockPlacementRule(BlockPlacementRule blockPlacementRule)
Registers aBlockPlacementRule
.void
registerCustomBlock(CustomBlock customBlock)
Registers aCustomBlock
.
-
Constructor Details
-
BlockManager
public BlockManager()
-
-
Method Details
-
registerCustomBlock
Registers aCustomBlock
.- Parameters:
customBlock
- the custom block to register- Throws:
java.lang.IllegalArgumentException
- ifcustomBlock
block id is not greater than 0java.lang.IllegalStateException
- if the id ofcustomBlock
is already registered
-
registerBlockPlacementRule
Registers aBlockPlacementRule
.- Parameters:
blockPlacementRule
- the block placement rule to register- Throws:
java.lang.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
-
getBlockPlacementRule
Gets theBlockPlacementRule
of the specific block.- Parameters:
blockStateId
- the block id to check- Returns:
- the block placement rule associated with the id, null if not any
-
getCustomBlock
Gets theCustomBlock
with the specific identifierCustomBlock.getIdentifier()
.- Parameters:
identifier
- the custom block identifier- Returns:
- the
CustomBlock
associated with the identifier, null if not any
-
getCustomBlock
Gets theCustomBlock
with the specific custom block idCustomBlock.getCustomBlockId()
.- Parameters:
id
- the custom block id- Returns:
- the
CustomBlock
associated with the id, null if not any
-