-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathClientInstaller46.java
executable file
·32 lines (30 loc) · 1.25 KB
/
ClientInstaller46.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Adding back the missing functionality for the Forge installer to launch the client install from the CLI
import java.io.OutputStream;
import java.io.File;
import java.io.IOException;
import net.minecraftforge.installer.json.InstallV1;
import net.minecraftforge.installer.json.Util;
import net.minecraftforge.installer.SimpleInstaller;
import net.minecraftforge.installer.actions.Actions;
import net.minecraftforge.installer.actions.ProgressCallback;
public class ClientInstaller46 {
public static void main(String[] args) throws IOException {
SimpleInstaller.headless = true;
System.setProperty("java.net.preferIPv4Stack", "true");
ProgressCallback monitor = ProgressCallback.withOutputs(new OutputStream[] { System.out });
Actions action = Actions.CLIENT;
try {
InstallV1 install = Util.loadInstallProfile();
File installer = new File(SimpleInstaller.class.getProtectionDomain().getCodeSource().getLocation().toURI());
if (!action.getAction(install, monitor).run(new File("."), installer)) {
System.out.println("Error");
System.exit(1);
}
System.out.println(action.getSuccess());
} catch (Throwable e) {
e.printStackTrace();
System.exit(1);
}
System.exit(0);
}
}