src/main/java/arcaratus/bloodarsenal/common/util/helper/PlayerHelper.java
public static RayTraceResult rayTrace(World world, PlayerEntity player, RayTraceContext.FluidMode fluidMode)
    {
        if (world == null || player == null)
            return null;

        float f = player.rotationPitch;
        float f1 = player.rotationYaw;
        Vector3d start = player.getEyePosition(1.0F);
        float f2 = MathHelper.cos(-f1 * ((float) Math.PI / 180F) - (float) Math.PI);
        float f3 = MathHelper.sin(-f1 * ((float) Math.PI / 180F) - (float) Math.PI);
        float f4 = -MathHelper.cos(-f * ((float) Math.PI / 180F));
        float f5 = MathHelper.sin(-f * ((float) Math.PI / 180F));
        float f6 = f3 * f4;
        float f7 = f2 * f4;
        double range = ConfigHandler.COMMON.rayTraceRange.get();
        Vector3d end = start.add((double) f6 * range, (double) f5 * range, (double) f7 * range);

        AxisAlignedBB aabb = player.getBoundingBox().expand(end).grow(1);
        RayTraceResult entityRayTrace = ProjectileHelper.rayTraceEntities(player, start, end, aabb, e -> e instanceof LivingEntity, range);

        return entityRayTrace != null ? entityRayTrace : world.rayTraceBlocks(new RayTraceContext(start, end, RayTraceContext.BlockMode.OUTLINE, fluidMode, player));
    }
/**
     * Modified raytrace method to first return an EntityRayTraceResult or else a BlockRayTraceResult
     */
Modified raytrace method to first return an EntityRayTraceResult or else a BlockRayTraceResult
Modified raytrace method to first return an EntityRayTraceResult or else a BlockRayTraceResult
public static RayTraceResult rayTrace(World world, PlayerEntity player, RayTraceContext.FluidMode fluidMode)
    {
        if (world == null || player == null)
            return null;
        float f = player.rotationPitch;
        float f1 = player.rotationYaw;
        Vector3d start = player.getEyePosition(1.0F);
        float f2 = MathHelper.cos(-f1 * ((float) Math.PI / 180F) - (float) Math.PI);
        float f3 = MathHelper.sin(-f1 * ((float) Math.PI / 180F) - (float) Math.PI);
        float f4 = -MathHelper.cos(-f * ((float) Math.PI / 180F));
        float f5 = MathHelper.sin(-f * ((float) Math.PI / 180F));
        float f6 = f3 * f4;
        float f7 = f2 * f4;
        double range = ConfigHandler.COMMON.rayTraceRange.get();
        Vector3d end = start.add((double) f6 * range, (double) f5 * range, (double) f7 * range);
        AxisAlignedBB aabb = player.getBoundingBox().expand(end).grow(1);
        RayTraceResult entityRayTrace = ProjectileHelper.rayTraceEntities(player, start, end, aabb, e -> e instanceof LivingEntity, range);
        return entityRayTrace != null ? entityRayTrace : world.rayTraceBlocks(new RayTraceContext(start, end, RayTraceContext.BlockMode.OUTLINE, fluidMode, player));
    }
public static RayTraceResult rayTrace ( World world , PlayerEntity player , RayTraceContext . FluidMode fluidMode ) { if ( world == null || player == null ) return null ; float f = player . rotationPitch ; float f1 = player . rotationYaw ; Vector3d start = player . getEyePosition ( 1.0F ) ; float f2 = MathHelper . cos ( - f1 * ( ( float ) Math . PI / 180F ) - ( float ) Math . PI ) ; float f3 = MathHelper . sin ( - f1 * ( ( float ) Math . PI / 180F ) - ( float ) Math . PI ) ; float f4 = - MathHelper . cos ( - f * ( ( float ) Math . PI / 180F ) ) ; float f5 = MathHelper . sin ( - f * ( ( float ) Math . PI / 180F ) ) ; float f6 = f3 * f4 ; float f7 = f2 * f4 ; double range = ConfigHandler . COMMON . rayTraceRange . get ( ) ; Vector3d end = start . add ( ( double ) f6 * range , ( double ) f5 * range , ( double ) f7 * range ) ; AxisAlignedBB aabb = player . getBoundingBox ( ) . expand ( end ) . grow ( 1 ) ; RayTraceResult entityRayTrace = ProjectileHelper . rayTraceEntities ( player , start , end , aabb , e -> e instanceof LivingEntity , range ) ; return entityRayTrace != null ? entityRayTrace : world . rayTraceBlocks ( new RayTraceContext ( start , end , RayTraceContext . BlockMode . OUTLINE , fluidMode , player ) ) ; }
Modified raytrace method to first return an EntityRayTraceResult or else a BlockRayTraceResult
Modified raytrace method to first return an EntityRayTraceResult or else a BlockRayTraceResult