Class AxisPlacementRule
java.lang.Object
net.minestom.server.instance.block.rule.BlockPlacementRule
net.minestom.server.instance.block.rule.vanilla.AxisPlacementRule
public class AxisPlacementRule extends BlockPlacementRule
-
Field Summary
-
Constructor Summary
Constructors Constructor Description AxisPlacementRule(Block block)
-
Method Summary
Modifier and Type Method Description short
blockPlace(Instance instance, Block block, BlockFace blockFace, Player pl)
Called when the block is placed.short
blockRefresh(Instance instance, BlockPosition blockPosition, short currentId)
Called when the block state id can be updated (for instance if a neighbour block changed).boolean
canPlace(Instance instance, BlockPosition blockPosition)
Gets if the block can be placed inblockPosition
.
-
Field Details
-
Constructor Details
-
Method Details
-
canPlace
Description copied from class:BlockPlacementRule
Gets if the block can be placed inblockPosition
. Can for example, be used for blocks which have to be placed on a solid block.- Specified by:
canPlace
in classBlockPlacementRule
- Parameters:
instance
- the instance of the blockblockPosition
- the position where the block is trying to get place- Returns:
- true if the block placement position is valid
-
blockRefresh
Description copied from class:BlockPlacementRule
Called when the block state id can be updated (for instance if a neighbour block changed).- Specified by:
blockRefresh
in classBlockPlacementRule
- Parameters:
instance
- the instance of the blockblockPosition
- the block positioncurrentId
- the current block state id of the block- Returns:
- the updated block state id
-
blockPlace
Description copied from class:BlockPlacementRule
Called when the block is placed.- Specified by:
blockPlace
in classBlockPlacementRule
- Parameters:
instance
- the instance of the blockblock
- the block placedblockFace
- the block facepl
- the player who placed the block- Returns:
- the block state id of the placed block
-