0% found this document useful (0 votes)
4 views6 pages

Minecraft Client Main Class Setup

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views6 pages

Minecraft Client Main Class Setup

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

package [Link].

main;

import [Link];
import [Link];
import [Link];
import [Link];
import [Link].blaze3d.Empty3i;
import [Link];

import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];

import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];

public class Main {


private static final Logger LOGGER = [Link]();

public static void main(String[] p_main_0_) {

try {
Managment.USER_PROFILE = new UserProfile([Link](),
[Link]());
} catch (Throwable throwable) {
Managment.USER_PROFILE = new UserProfile("",
1);
}

OptionParser optionparser = new OptionParser();


[Link]();
[Link]("demo");
[Link]("disableMultiplayer");
[Link]("disableChat");
[Link]("fullscreen");
[Link]("checkGlErrors");
OptionSpec<String> optionspec =
[Link]("server").withRequiredArg();
OptionSpec<Integer> optionspec1 =
[Link]("port").withRequiredArg().ofType([Link]).defaultsTo(255
65);
OptionSpec<File> optionspec2 =
[Link]("gameDir").withRequiredArg().ofType([Link]).defaultsTo(new
File("."));
OptionSpec<File> optionspec3 =
[Link]("assetsDir").withRequiredArg().ofType([Link]);
OptionSpec<File> optionspec4 =
[Link]("resourcePackDir").withRequiredArg().ofType([Link]);
OptionSpec<File> optionspec5 =
[Link]("dataPackDir").withRequiredArg().ofType([Link]);
OptionSpec<String> optionspec6 =
[Link]("proxyHost").withRequiredArg();
OptionSpec<Integer> optionspec7 =
[Link]("proxyPort").withRequiredArg().defaultsTo("8080").ofType(Integ
[Link]);
OptionSpec<String> optionspec8 =
[Link]("proxyUser").withRequiredArg();
OptionSpec<String> optionspec9 =
[Link]("proxyPass").withRequiredArg();
OptionSpec<String> optionspec10 =
[Link]("username").withRequiredArg().defaultsTo("EXPRandom" +
[Link]() % 1000L);
OptionSpec<String> optionspec11 =
[Link]("uuid").withRequiredArg();
OptionSpec<String> optionspec12 =
[Link]("accessToken").withRequiredArg().required();
OptionSpec<String> optionspec13 =
[Link]("version").withRequiredArg().required();
OptionSpec<Integer> optionspec14 =
[Link]("width").withRequiredArg().ofType([Link]).defaultsTo(85
4);
OptionSpec<Integer> optionspec15 =
[Link]("height").withRequiredArg().ofType([Link]).defaultsTo(4
80);
OptionSpec<Integer> optionspec16 =
[Link]("fullscreenWidth").withRequiredArg().ofType([Link]);
OptionSpec<Integer> optionspec17 =
[Link]("fullscreenHeight").withRequiredArg().ofType([Link]);
OptionSpec<String> optionspec18 =
[Link]("userProperties").withRequiredArg().defaultsTo("{}");
OptionSpec<String> optionspec19 =
[Link]("profileProperties").withRequiredArg().defaultsTo("{}");
OptionSpec<String> optionspec20 =
[Link]("assetIndex").withRequiredArg();
OptionSpec<String> optionspec21 =
[Link]("userType").withRequiredArg().defaultsTo("legacy");
OptionSpec<String> optionspec22 =
[Link]("versionType").withRequiredArg().defaultsTo("release");
OptionSpec<String> optionspec23 = [Link]();
OptionSet optionset = [Link](p_main_0_);
List<String> list = [Link](optionspec23);

if (![Link]()) {
[Link]("Completely ignored arguments: " + list);
}

String s = getValue(optionset, optionspec6);


Proxy proxy = Proxy.NO_PROXY;

if (s != null) {
try {
proxy = new Proxy([Link], new InetSocketAddress(s,
getValue(optionset, optionspec7)));
} catch (Exception exception) {
}
}

final String s1 = getValue(optionset, optionspec8);


final String s2 = getValue(optionset, optionspec9);

if (![Link](Proxy.NO_PROXY) && isNotEmpty(s1) && isNotEmpty(s2)) {


[Link](new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(s1, [Link]());
}
});
}

int i = getValue(optionset, optionspec14);


int j = getValue(optionset, optionspec15);
OptionalInt optionalint = toOptionalInt(getValue(optionset, optionspec16));
OptionalInt optionalint1 = toOptionalInt(getValue(optionset,
optionspec17));
boolean flag = [Link]("fullscreen");
boolean flag1 = [Link]("demo");
boolean flag2 = [Link]("disableMultiplayer");
boolean flag3 = [Link]("disableChat");
String s3 = getValue(optionset, optionspec13);
Gson gson = (new GsonBuilder()).registerTypeAdapter([Link], new
Serializer()).create();
PropertyMap propertymap = [Link](gson, getValue(optionset,
optionspec18), [Link]);
PropertyMap propertymap1 = [Link](gson, getValue(optionset,
optionspec19), [Link]);
String s4 = getValue(optionset, optionspec22);
File file1 = getValue(optionset, optionspec2);
File file2 = [Link](optionspec3) ? getValue(optionset,
optionspec3) : new File(file1, "assets/");
File file3 = [Link](optionspec4) ? getValue(optionset,
optionspec4) : new File(file1, "resourcepacks/");
String s5 = [Link](optionspec11) ? [Link](optionset) :
[Link]([Link](optionset)).toString();
String s6 = [Link](optionspec20) ? [Link](optionset) :
null;
String s7 = getValue(optionset, optionspec);
Integer integer = getValue(optionset, optionspec1);
[Link]();
[Link]();
[Link]();
Util.func_240994_l_();
Session session = new Session([Link](optionset), s5,
[Link](optionset), [Link](optionset));
GameConfiguration gameconfiguration = new GameConfiguration(new
[Link](session, propertymap, propertymap1, proxy), new
ScreenSize(i, j, optionalint, optionalint1, flag), new
[Link](file1, file3, file2, s6), new
[Link](flag1, s3, s4, flag2, flag3), new
[Link](s7, integer));
Thread thread = new Thread("Client Shutdown Thread") {
public void run() {
if ([Link]) {
try {
[Link]();
} catch (Exception e) {
[Link]();
}
[Link] = false;
}
Minecraft minecraft1 = [Link]();

if (minecraft1 != null) {
IntegratedServer integratedserver =
[Link]();

if (integratedserver != null) {
[Link](true);
}
}
}
};
[Link](new
DefaultUncaughtExceptionHandler(LOGGER));
[Link]().addShutdownHook(thread);
new Empty3i();
final Minecraft minecraft;

try {
[Link]().setName("Render thread");
[Link]();
[Link]();
minecraft = new Minecraft(gameconfiguration);
[Link]();
} catch (UndeclaredException undeclaredexception) {
[Link]("Failed to create window: ", (Throwable)
undeclaredexception);
return;
} catch (Throwable throwable1) {
CrashReport crashreport = [Link](throwable1,
"Initializing game");
[Link]("Initialization");
[Link]((LanguageManager) null,
[Link], (GameSettings) null, crashreport);
[Link](crashreport);
return;
}

Thread thread1;
if ([Link]()) {
thread1 = new Thread("Game thread") {
public void run() {
try {
[Link](true);
[Link]();
} catch (Throwable throwable2) {
[Link]("Exception in client thread",
throwable2);
}
}
};
[Link]();

while ([Link]()) {
}
} else {
thread1 = null;

try {
[Link](false);
[Link]();
} catch (Throwable throwable) {
[Link]("Unhandled game exception", throwable);
}
}

try {
[Link]();

if (thread1 != null) {
[Link]();
}
} catch (InterruptedException interruptedexception) {
[Link]("Exception during client thread shutdown", (Throwable)
interruptedexception);
} finally {
[Link]();
}
}

private static OptionalInt toOptionalInt(@Nullable Integer value) {


return value != null ? [Link](value) : [Link]();
}

@Nullable
private static <T> T getValue(OptionSet set, OptionSpec<T> option) {
try {
return [Link](option);
} catch (Throwable throwable) {
if (option instanceof ArgumentAcceptingOptionSpec) {
ArgumentAcceptingOptionSpec<T> argumentacceptingoptionspec =
(ArgumentAcceptingOptionSpec) option;
List<T> list = [Link]();

if (![Link]()) {
return [Link](0);
}
}
throw throwable;
}
}

/**
* Returns true if the given string is neither null nor empty.
*/
private static boolean isNotEmpty(@Nullable String str) {
return str != null && ![Link]();
}

static {
[Link]("[Link]", "true");
}
}

You might also like