net.mina Maven / Gradle / Ivy
package net;
import com.fasterxml.jackson.core.JsonProcessingException;
import net.k3nder.core.json.version.versionJson;
import net.k3nder.core.mc.Manifest;
import net.k3nder.core.mc.Mc;
import net.k3nder.core.mc.Vmc;
import net.k3nder.core.mc.clients.fabric.Fabric;
import net.k3nder.core.mc.clients.quilt.Quilt;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Path;
import java.util.Scanner;
import static net.k3nder.core.mc.Mc.MINECRAFT_PATH;
public class mina {
public static void main(String[] args) throws IOException, URISyntaxException {
Scanner scan = new Scanner(System.in);
System.out.print("Please enter the path to the minecraft folder (Default) : ");
String path = scan.nextLine();
if(path == null || path.isEmpty()) path = MINECRAFT_PATH;
Mc mc = new Mc(Path.of(path));
System.out.println("1: Vanilla");
System.out.println("2: Quilt");
System.out.println("3: Fabric");
System.out.print("Enter: ");
int mode = scan.nextInt();
System.out.print("Mc Version (Default Latest): ");
String version = scan.nextLine();
Vmc versionV = null;
File temp = new File("temp.json");
if(mode != 1) {
System.out.println("Loader version (Default Latest): ");
String l_version = scan.nextLine();
if(mode == 2) {
if(version == null || version.isEmpty()) version = new Manifest().getLastVersion().getID();
if(l_version == null || l_version.isEmpty()) l_version = Quilt.getLoadersVersions(version).getFirst();
versionV = new Quilt(version, l_version);
} else if (mode == 3) {
if(version == null || version.isEmpty()) version = new Manifest().getLastVersion().getID();
if(l_version == null || l_version.isEmpty()) l_version = Fabric.getLoadersVersions(version).getFirst();
versionV = new Fabric(version, l_version);
}
} else {
if(version == null || version.isEmpty()) version = new Manifest().getLastVersion().getID();
versionV = new Manifest().getVersion(version);
}
System.out.println("download (Y/n)");
scan.nextLine();
versionJson vr = versionV.cloneLoad(temp);
mc.download(vr);
System.out.println("initialize (Y/n)");
scan.nextLine();
mc.run(vr);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy