Aha! There was missing syntax

This commit is contained in:
zontreck 2023-12-06 09:35:23 -07:00
parent 611aa4e351
commit 84b9401b2f

View file

@ -1216,13 +1216,9 @@ public final class Minecraft implements Runnable {
public static void main(String[] args) {
if(System.getProperty("minecraft.auth_token") == "")
{
// Set debug values
args = new String[] {"--username=zontreck"};
}
Minecraft minecraft = new Minecraft((Canvas) null, 800, 600, false);
public static void main(String[] args)
{
Minecraft minecraft = new Minecraft((Canvas)null, 800, 600, false);
Random rng = new Random();
rng.setSeed(Instant.now().getEpochSecond());
@ -1233,11 +1229,10 @@ public final class Minecraft implements Runnable {
Arguments parser = ArgumentsParser.parseArguments(args, defaults);
StringArgument unArg = (StringArgument) parser.getArg("username");
if (parser.hasArg("username"))
minecraft.user = new User(unArg.getValue(), System.getProperty("minecraft.auth_token"));
else minecraft.user = new User("Player", "-");
if(parser.hasArg("username")) minecraft.user = new User(unArg.getValue(), System.getProperty("minecraft.auth_token"));
if (parser.hasArg("server")) {
if(parser.hasArg("server"))
{
IntegerArgument serverArg = (IntegerArgument) parser.getArg("server");
// Acquire the server ip and port from Aria's Creations
@ -1255,18 +1250,22 @@ public final class Minecraft implements Runnable {
throw new RuntimeException(e);
}
if (response.getResponseCode() == 200) {
if(response.getResponseCode()==200)
{
System.out.println("Response is valid, server found at: " + response.getResponseBody());
String[] lReply = response.getResponseBody().split(";");
minecraft.server = lReply[0];
minecraft.port = Integer.parseInt(lReply[1]);
minecraft.user.mpPass = lReply[2];
} else {
System.out.println("Server could not be found!\nID: " + serverArg.getValue() + "\nHTTP Response: " + response.getResponseBody());
}else {
System.out.println("Server could not be found!\nID: " + serverArg.getValue()+ "\nHTTP Response: " + response.getResponseBody());
return;
}
}
new Thread(minecraft).start();
}
}