Interface VoxelShapeComponents.IComponent
- All Known Implementing Classes:
VoxelShapeComponentsFactoryHandlerCableCenter.Component,VoxelShapeComponentsFactoryHandlerCableConnections.Component,VoxelShapeComponentsFactoryHandlerFacade.Component,VoxelShapeComponentsFactoryHandlerParts.Component
- Enclosing class:
VoxelShapeComponents
public static interface VoxelShapeComponents.IComponent
-
Method Summary
Modifier and TypeMethodDescriptionbooleandestroy(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, boolean saveState) Destroy this componentnet.minecraft.world.item.ItemStackgetCloneItemStack(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Get the pick block item.net.minecraft.core.Directionnet.minecraft.world.phys.shapes.VoxelShapegetShape(net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.BlockGetter world, net.minecraft.core.BlockPos blockPos, net.minecraft.world.phys.shapes.CollisionContext selectionContext) Get the shape of this component.getStateId(net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.BlockGetter world, net.minecraft.core.BlockPos blockPos) booleannet.minecraft.world.InteractionResultonBlockActivated(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos blockPos, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand, BlockRayTraceResultComponent hit) When this component has been activated.
-
Method Details
-
getStateId
String getStateId(net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.BlockGetter world, net.minecraft.core.BlockPos blockPos) - Parameters:
blockState- The block state.world- The world.blockPos- The position.- Returns:
- Unique identifier for the component's state.
-
getShape
net.minecraft.world.phys.shapes.VoxelShape getShape(net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.BlockGetter world, net.minecraft.core.BlockPos blockPos, net.minecraft.world.phys.shapes.CollisionContext selectionContext) Get the shape of this component.- Parameters:
blockState- The block state.world- The world.blockPos- The position.selectionContext- The selection context.- Returns:
- The shape.
-
getCloneItemStack
net.minecraft.world.item.ItemStack getCloneItemStack(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Get the pick block item.- Parameters:
world- The worldpos- The position- Returns:
- The item.
-
destroy
boolean destroy(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, boolean saveState) Destroy this component- Parameters:
world- The worldpos- The positionplayer- The player destroying the component.saveState- If the component state should be saved in the dropped item.- Returns:
- If the complete block was destroyed
-
onBlockActivated
net.minecraft.world.InteractionResult onBlockActivated(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos blockPos, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand, BlockRayTraceResultComponent hit) When this component has been activated.- Parameters:
state- The block state.world- The world.blockPos- The position.player- The player.hand- The hand.hit- The ray trace result.- Returns:
- Action result.
-
getRaytraceDirection
@Nullable net.minecraft.core.Direction getRaytraceDirection()- Returns:
- The direction this component points at.
-
isRaytraceLastForFace
boolean isRaytraceLastForFace()- Returns:
- If this component should only be raytraced if no other components matched for this face.
-