Class VoxelShapeComponentsFactoryHandlerParts.Component
java.lang.Object
org.cyclops.integrateddynamics.block.shapes.VoxelShapeComponentsFactoryHandlerParts.Component
- All Implemented Interfaces:
VoxelShapeComponents.IComponent
- Enclosing class:
- VoxelShapeComponentsFactoryHandlerParts
public static class VoxelShapeComponentsFactoryHandlerParts.Component
extends Object
implements VoxelShapeComponents.IComponent
-
Constructor Summary
ConstructorDescriptionComponent
(net.minecraft.core.Direction direction, IPartContainer partContainer) -
Method Summary
Modifier and TypeMethodDescriptionboolean
destroy
(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, boolean saveState) Destroy this componentnet.minecraft.client.resources.model.BakedModel
getBreakingBaseModel
(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) net.minecraft.world.item.ItemStack
getCloneItemStack
(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) Get the pick block item.getPart()
net.minecraft.core.Direction
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.getStateId
(net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.BlockGetter world, net.minecraft.core.BlockPos blockPos) boolean
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.
-
Constructor Details
-
Component
-
-
Method Details
-
getPart
-
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:
getStateId
in 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.IComponent
Get the shape of this component.- Specified by:
getShape
in 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.IComponent
Get the pick block item.- Specified by:
getCloneItemStack
in 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.IComponent
Destroy this component- Specified by:
destroy
in 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
-
getBreakingBaseModel
@Nullable public net.minecraft.client.resources.model.BakedModel getBreakingBaseModel(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) - Specified by:
getBreakingBaseModel
in interfaceVoxelShapeComponents.IComponent
- Parameters:
world
- The worldpos
- The position- Returns:
- The model that will be used to render the breaking overlay.
-
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.IComponent
When this component has been activated.- Specified by:
onBlockActivated
in 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:
getRaytraceDirection
in interfaceVoxelShapeComponents.IComponent
- Returns:
- The direction this component points at.
-
isRaytraceLastForFace
public boolean isRaytraceLastForFace()- Specified by:
isRaytraceLastForFace
in interfaceVoxelShapeComponents.IComponent
- Returns:
- If this component should only be raytraced if no other components matched for this face.
-