use of codechicken.lib.raytracer.CuboidRayTraceResult in project GregTech by GregTechCE.
the class BlockPipe method getPickBlock.
@Override
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
IPipeTile<PipeType, NodeDataType> pipeTile = getPipeTileEntity(world, pos);
if (pipeTile == null) {
return ItemStack.EMPTY;
}
if (target instanceof CuboidRayTraceResult) {
CuboidRayTraceResult result = (CuboidRayTraceResult) target;
if (result.cuboid6.data instanceof CoverSideData) {
EnumFacing coverSide = ((CoverSideData) result.cuboid6.data).side;
CoverBehavior coverBehavior = pipeTile.getCoverableImplementation().getCoverAtSide(coverSide);
return coverBehavior == null ? ItemStack.EMPTY : coverBehavior.getPickItem();
}
}
return getDropItem(pipeTile);
}
Aggregations