protected static LoginResponse authenticateWithAuthlib (String user, String pass, String mojangData, String selectedProfileName) {
String displayName;
boolean hasMojangData = false;
boolean hasPassword = false;
GameProfile selectedProfile = null;
YggdrasilUserAuthentication authentication = (YggdrasilUserAuthentication) new YggdrasilAuthenticationService(Proxy.NO_PROXY, "1").createUserAuthentication(Agent.MINECRAFT);
if (user != null) {
Logger.logDebug(user.contains("@") ? "Email address given" : "Username given" + " Not 100% sure, mojangdata might contain different username");
Logger.logInfo("Beginning authlib authentication attempt");
Logger.logInfo("successfully created YggdrasilAuthenticationService");
authentication.setUsername(user);