Search in sources :

Example 1 with AttributeStateFacing

use of mekanism.common.block.attribute.AttributeStateFacing in project Mekanism by mekanism.

the class BlockBase method getShape.

@Nonnull
@Override
@Deprecated
public VoxelShape getShape(@Nonnull BlockState state, @Nonnull IBlockReader world, @Nonnull BlockPos pos, @Nonnull ISelectionContext context) {
    if (type.has(AttributeCustomShape.class)) {
        AttributeStateFacing attr = type.get(AttributeStateFacing.class);
        int index = attr == null ? 0 : (attr.getDirection(state).ordinal() - (attr.getFacingProperty() == BlockStateProperties.FACING ? 0 : 2));
        return type.get(AttributeCustomShape.class).getBounds()[index];
    }
    return super.getShape(state, world, pos, context);
}
Also used : AttributeStateFacing(mekanism.common.block.attribute.AttributeStateFacing) Nonnull(javax.annotation.Nonnull)

Aggregations

Nonnull (javax.annotation.Nonnull)1 AttributeStateFacing (mekanism.common.block.attribute.AttributeStateFacing)1