package xyz.openmodloader.launcher;

import com.google.gson.GsonBuilder;
import com.mojang.authlib.Agent;
import com.mojang.authlib.exceptions.AuthenticationException;
import com.mojang.authlib.properties.PropertyMap;
import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication;
import net.minecraft.launchwrapper.Launch;
import xyz.openmodloader.launcher.strippable.Side;


import java.io.File;
import java.net.Proxy;
import java.util.Arrays;

public class OpenModLoaderClient {
    public static void main(String[] args) {
        System.setProperty("org.lwjgl.librarypath", new File("../.gradle/minecraft/natives/").getAbsolutePath());
        OMLStrippableTransformer.SIDE = Side.CLIENT;
        LaunchArguments arguments = new LaunchArguments(args);

        if (arguments.containsArgument("password")) {
            YggdrasilUserAuthentication auth = (YggdrasilUserAuthentication) (new YggdrasilAuthenticationService(Proxy.NO_PROXY, "1")).createUserAuthentication(Agent.MINECRAFT);
            auth.setUsername(arguments.getArgument("username"));
            auth.setPassword(arguments.getArgument("password"));
            arguments.removeArgument("password");

            try {
                auth.logIn();
            } catch (AuthenticationException e) {
                e.printStackTrace();
                return;
            }

            arguments.addArgument("accessToken", auth.getAuthenticatedToken());
            arguments.addArgument("uuid", auth.getSelectedProfile().getId().toString().replace("-", ""));
            arguments.addArgument("username", auth.getSelectedProfile().getName());
            arguments.addArgument("userType", auth.getUserType().getName());
            arguments.addArgument("userProperties", new GsonBuilder().registerTypeAdapter(PropertyMap.class, new PropertyMap.Serializer()).create().toJson(auth.getUserProperties()));
        }

        arguments.addArgument("version", "1.10.2");
        arguments.addArgument("assetIndex", "1.10");
        arguments.addArgument("accessToken", "OpenModLoader");
        arguments.addArgument("tweakClass", "xyz.openmodloader.launcher.OMLTweaker");

        Launch.main(arguments.getArguments());
    }
}

@@ -30,16 +30,61 @@
 ncher;%0A%0A
+import java.io.File;%0Aimport java.net.Proxy;%0A%0A
 import c
@@ -111,16 +111,16 @@
 uilder;%0A
-
 import c
@@ -385,24 +385,25 @@
 entication;%0A
+%0A
 import net.m
@@ -489,79 +489,8 @@
 e;%0A%0A
-%0Aimport java.io.File;%0Aimport java.net.Proxy;%0Aimport java.util.Arrays;%0A%0A
 publ
@@ -577,93 +577,218 @@
     
-System.setProperty(%22org.lwjgl.librarypath%22, new File(%22../.gradle/minecraft/natives/%22)
+File file = new File(%22.gradle/minecraft/natives/%22);%0A        if (!file.exists()) %7B%0A            file = new File(%22../.gradle/minecraft/natives/%22);%0A        %7D%0A        System.setProperty(%22org.lwjgl.librarypath%22, file
 .get

Fix issue with Eclipse