net.minecraft.util.math.shapes.ISelectionContext Java Examples

The following examples show how to use net.minecraft.util.math.shapes.ISelectionContext. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BlockEnderTank.java    From EnderStorage with MIT License 5 votes vote down vote up
@Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
    VoxelShape shape = TANK_SHAPE;
    TileEntity t = worldIn.getTileEntity(pos);
    if (t instanceof TileEnderTank) {
        TileEnderTank tile = (TileEnderTank) t;
        shape = SHAPES[tile.rotation];
    }
    return shape;
}
 
Example #2
Source File: BlockEnderChest.java    From EnderStorage with MIT License 5 votes vote down vote up
@Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
    VoxelShape shape = CHEST_SHAPE;
    TileEntity t = worldIn.getTileEntity(pos);
    if (t instanceof TileEnderChest) {
        TileEnderChest tile = (TileEnderChest) t;
        shape = SHAPES[tile.rotation][tile.getRadianLidAngle(0) >= 0 ? 0 : 1];
    }
    return shape;
}
 
Example #3
Source File: MinersLight.java    From MiningGadgets with MIT License 4 votes vote down vote up
@Override
public VoxelShape getCollisionShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
    return VoxelShapes.empty();
}
 
Example #4
Source File: MinersLight.java    From MiningGadgets with MIT License 4 votes vote down vote up
/**
 * @deprecated call via {@link BlockState#getPushReaction()} whenever possible. Implementing/overriding is fine.
 */
@Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext selectionContext) {
    return SHAPE;
}
 
Example #5
Source File: ChoppingBlock.java    From Survivalist with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context)
{
    return SHAPE;
}
 
Example #6
Source File: DryingRackBlock.java    From Survivalist with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context)
{
    return (state.get(FACING).getHorizontalIndex() % 2) == 0 ? shape1 : shape2;
}