Program: 13390
Project: 13390
Buggy source:
@Override public EnumActionResult onItemUse(EntityPlayer player,World world,BlockPos pos,EnumHand hand,EnumFacing side,float hitX,float hitY,float hitZ){
  return IEContent.itemWireCoil.onItemUse(player,world,pos,hand,side,hitX,hitY,hitZ);
}

Fixed version (ground truth):
@Override public EnumActionResult onItemUse(EntityPlayer player,World world,BlockPos pos,EnumHand hand,EnumFacing side,float hitX,float hitY,float hitZ){
  TileEntity tileEntity=world.getTileEntity(pos);
  if (tileEntity instanceof IImmersiveConnectable && ((IImmersiveConnectable)tileEntity).canConnect()) {
    ItemStack stack=player.getHeldItem(hand);
    TargetingInfo target=new TargetingInfo(side,hitX,hitY,hitZ);
    WireType wire=getWireType(stack);
    BlockPos masterPos=((IImmersiveConnectable)tileEntity).getConnectionMaster(wire,target);
    tileEntity=world.getTileEntity(masterPos);
    if (!(tileEntity instanceof IImmersiveConnectable) || !((IImmersiveConnectable)tileEntity).canConnect()) {
      return EnumActionResult.PASS;
    }
    if (!((IImmersiveConnectable)tileEntity).canConnectCable(wire,target)) {
      if (!world.isRemote) {
        player.sendMessage(new TextComponentTranslation(Lib.CHAT_WARN + "String_Node_Str"));
      }
      return EnumActionResult.FAIL;
    }
    if (!world.isRemote) {
      if (!ItemNBTHelper.hasKey(stack,"String_Node_Str")) {
        ItemNBTHelper.setIntArray(stack,"String_Node_Str",new int[]{world.provider.getDimension(),masterPos.getX(),masterPos.getY(),masterPos.getZ()});
        NBTTagCompound targetNbt=new NBTTagCompound();
        target.writeToNBT(targetNbt);
        ItemNBTHelper.setTagCompound(stack,"String_Node_Str",targetNbt);
      }
 else {
        WireType type=getWireType(stack);
        int[] array=ItemNBTHelper.getIntArray(stack,"String_Node_Str");
        BlockPos linkPos=new BlockPos(array[1],array[2],array[3]);
        TileEntity tileEntityLinkingPos=world.getTileEntity(linkPos);
        int distanceSq=(int)Math.ceil(linkPos.distanceSq(masterPos));
        if (array[0] != world.provider.getDimension()) {
          player.sendMessage(new TextComponentTranslation(Lib.CHAT_WARN + "String_Node_Str"));
        }
 else         if (linkPos.equals(masterPos)) {
          player.sendMessage(new TextComponentTranslation(Lib.CHAT_WARN + "String_Node_Str"));
        }
 else         if (distanceSq > (type.getMaxLength() * type.getMaxLength())) {
          player.sendMessage(new TextComponentTranslation(Lib.CHAT_WARN + "String_Node_Str"));
        }
 else {
          TargetingInfo targetLink=TargetingInfo.readFromNBT(ItemNBTHelper.getTagCompound(stack,"String_Node_Str"));
          if (!(tileEntityLinkingPos instanceof IImmersiveConnectable) || !((IImmersiveConnectable)tileEntityLinkingPos).canConnectCable(wire,targetLink)) {
            player.sendMessage(new TextComponentTranslation(Lib.CHAT_WARN + "String_Node_Str"));
          }
 else {
            IImmersiveConnectable nodeHere=(IImmersiveConnectable)tileEntity;
            IImmersiveConnectable nodeLink=(IImmersiveConnectable)tileEntityLinkingPos;
            boolean connectionExists=false;
            Set<Connection> outputs=ImmersiveNetHandler.INSTANCE.getConnections(world,Utils.toCC(nodeHere));
            if (outputs != null) {
              for (              Connection con : outputs) {
                if (con.end.equals(Utils.toCC(nodeLink))) {
                  connectionExists=true;
                }
              }
            }
            if (connectionExists) {
              player.sendMessage(new TextComponentTranslation(Lib.CHAT_WARN + "String_Node_Str"));
            }
 else {
              Vec3d rtOff0=nodeHere.getRaytraceOffset(nodeLink).addVector(masterPos.getX(),masterPos.getY(),masterPos.getZ());
              Vec3d rtOff1=nodeLink.getRaytraceOffset(nodeHere).addVector(linkPos.getX(),linkPos.getY(),linkPos.getZ());
              Set<BlockPos> ignore=new HashSet<>();
              ignore.addAll(nodeHere.getIgnored(nodeLink));
              ignore.addAll(nodeLink.getIgnored(nodeHere));
              boolean canSee=Utils.rayTraceForFirst(rtOff0,rtOff1,world,ignore) == null;
              if (canSee) {
                ImmersiveNetHandler.INSTANCE.addConnection(world,Utils.toCC(nodeHere),Utils.toCC(nodeLink),(int)Math.sqrt(distanceSq),type);
                nodeHere.connectCable(type,target,nodeLink);
                nodeLink.connectCable(type,targetLink,nodeHere);
                IESaveData.setDirty(world.provider.getDimension());
                Utils.unlockIEAdvancement(player,"String_Node_Str");
                if (!player.capabilities.isCreativeMode) {
                  stack.shrink(1);
                }
                ((TileEntity)nodeHere).markDirty();
                world.addBlockEvent(masterPos,((TileEntity)nodeHere).getBlockType(),-1,0);
                IBlockState state=world.getBlockState(masterPos);
                world.notifyBlockUpdate(masterPos,state,state,3);
                ((TileEntity)nodeLink).markDirty();
                world.addBlockEvent(linkPos,((TileEntity)nodeLink).getBlockType(),-1,0);
                state=world.getBlockState(linkPos);
                world.notifyBlockUpdate(linkPos,state,state,3);
              }
 else {
                player.sendMessage(new TextComponentTranslation(Lib.CHAT_WARN + "String_Node_Str"));
              }
            }
          }
        }
        ItemNBTHelper.remove(stack,"String_Node_Str");
        ItemNBTHelper.remove(stack,"String_Node_Str");
      }
    }
    return EnumActionResult.SUCCESS;
  }
  return EnumActionResult.PASS;
}