Class VoxelShapeComponentsFactoryHandlerFacade.Component
java.lang.Object
org.cyclops.integrateddynamics.block.shapes.VoxelShapeComponentsFactoryHandlerFacade.Component
- All Implemented Interfaces:
VoxelShapeComponents.IComponent
- Enclosing class:
VoxelShapeComponentsFactoryHandlerFacade
public static class VoxelShapeComponentsFactoryHandlerFacade.Component
extends Object
implements VoxelShapeComponents.IComponent
-
Constructor Summary
Constructors -
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.
-
Constructor Details
-
Component
public Component()
-
-
Method Details
-
getStateId
public String getStateId(net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.BlockGetter world, net.minecraft.core.BlockPos blockPos) - Specified by:
getStateIdin interfaceVoxelShapeComponents.IComponent- Parameters:
blockState- The block state.world- The world.blockPos- The position.- Returns:
- Unique identifier for the component's state.
-
getShape
public 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) Description copied from interface:VoxelShapeComponents.IComponentGet the shape of this component.- Specified by:
getShapein interfaceVoxelShapeComponents.IComponent- Parameters:
blockState- The block state.world- The world.blockPos- The position.selectionContext- The selection context.- Returns:
- The shape.
-
getCloneItemStack
public net.minecraft.world.item.ItemStack getCloneItemStack(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Description copied from interface:VoxelShapeComponents.IComponentGet the pick block item.- Specified by:
getCloneItemStackin interfaceVoxelShapeComponents.IComponent- Parameters:
world- The worldpos- The position- Returns:
- The item.
-
destroy
public boolean destroy(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, boolean saveState) Description copied from interface:VoxelShapeComponents.IComponentDestroy this component- Specified by:
destroyin interfaceVoxelShapeComponents.IComponent- 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
public 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) Description copied from interface:VoxelShapeComponents.IComponentWhen this component has been activated.- Specified by:
onBlockActivatedin interfaceVoxelShapeComponents.IComponent- 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 public net.minecraft.core.Direction getRaytraceDirection()- Specified by:
getRaytraceDirectionin interfaceVoxelShapeComponents.IComponent- Returns:
- The direction this component points at.
-
isRaytraceLastForFace
public boolean isRaytraceLastForFace()- Specified by:
isRaytraceLastForFacein interfaceVoxelShapeComponents.IComponent- Returns:
- If this component should only be raytraced if no other components matched for this face.
-