content: package mcmultipart;
  
  import org.apache.commons.lang3.tuple.Pair;
  
  import net.minecraft.entity.player.EntityPlayer;
  import net.minecraft.entity.player.EntityPlayerMP;
  import net.minecraft.util.math.MathHelper;
  import net.minecraft.util.math.Vec3d;
  
  public class RayTraceHelper {
  
      public static Pair<Vec3d, Vec3d> getRayTraceVectors(EntityPlayer player) {
          float pitch = player.rotationPitch;
          float yaw = player.rotationYaw;
          Vec3d start = new Vec3d(player.posX, player.posY + player.getEyeHeight(), player.posZ);
          float f1 = MathHelper.cos(-yaw * 0.017453292F - (float) Math.PI);
          float f2 = MathHelper.sin(-yaw * 0.017453292F - (float) Math.PI);
          float f3 = -MathHelper.cos(-pitch * 0.017453292F);
          float f4 = MathHelper.sin(-pitch * 0.017453292F);
          float f5 = f2 * f3;
          float f6 = f1 * f3;
          double d3 = 5.0D;
          if (player instanceof EntityPlayerMP) {
              d3 = ((EntityPlayerMP) player).interactionManager.getBlockReachDistance();
          }
          Vec3d end = start.addVector(f5 * d3, f4 * d3, f6 * d3);
          return Pair.of(start, end);
      }
  
  }
  