Update source to eaglercraft.com

This commit is contained in:
PeytonPlayz595 2024-07-16 22:49:40 -04:00
parent 444d395024
commit e66bcfa081
6 changed files with 152 additions and 26 deletions

View File

@ -89,4 +89,8 @@ public class BufferedImage {
public int getHeight() {
return h;
}
public int[] getData() {
return data;
}
}

File diff suppressed because one or more lines are too long

View File

@ -69,6 +69,7 @@ import net.lax1dude.eaglercraft.adapter.teavm.WebGLVertexArray;
import net.minecraft.src.MathHelper;
import net.PeytonPlayz585.opengl.GL11;
import net.PeytonPlayz585.storage.LocalStorageManager;
import net.lax1dude.eaglercraft.EarlyLoadScreen;
import net.lax1dude.eaglercraft.AssetRepository;
import net.lax1dude.eaglercraft.Base64;
import net.lax1dude.eaglercraft.Client;
@ -76,8 +77,6 @@ import net.lax1dude.eaglercraft.BufferedImage;
import net.lax1dude.eaglercraft.JSONObject;
import net.lax1dude.eaglercraft.adapter.teavm.IndexedDBFilesystem;
import net.lax1dude.eaglercraft.adapter.teavm.IndexedDBFilesystem.OpenState;
//import net.lax1dude.eaglercraft.adapter.teavm.IndexedDBFilesystem;
//import net.lax1dude.eaglercraft.adapter.teavm.IndexedDBFilesystem.OpenState;
import net.lax1dude.eaglercraft.adapter.teavm.WebGL2RenderingContext;
import static net.lax1dude.eaglercraft.adapter.teavm.WebGL2RenderingContext.*;
@ -320,6 +319,8 @@ public class EaglerAdapterImpl2 {
dataBaseName = config.getString("dataBaseName");
}
EarlyLoadScreen.paintScreen();
OpenState st = IndexedDBFilesystem.initialize();
if(st != OpenState.OPENED) {
if(st == OpenState.LOCKED) {

View File

@ -6,17 +6,33 @@ public class GuiConnecting extends GuiScreen {
private NetClientHandler clientHandler;
private boolean cancelled = false;
private Minecraft minecraft;
private String uri;
private int timer = 0;
public GuiConnecting(Minecraft var1, String var2) {
System.out.println("Connecting to " + var2);
var1.changeWorld1((World)null);
(new ThreadConnectToServer(this, var1, var2)).start();
this.minecraft = var1;
this.uri = var2;
}
public void updateScreen() {
/*
* Connects AFTER drawing screen, this fixes two issues
* 1. A blank background while the connection is being initialized
* 2. The connection failed screen not showing due to the connecting screen being rendered AFTER the connection failed
*/
if (timer > 2 && this.clientHandler == null) {
(new ThreadConnectToServer(this, this.minecraft, this.uri)).start();
}
if(this.clientHandler != null) {
this.clientHandler.processReadPackets();
}
if(timer >= 1) {
++timer;
}
}
protected void keyTyped(char var1, int var2) {
@ -41,6 +57,10 @@ public class GuiConnecting extends GuiScreen {
}
public void drawScreen(int var1, int var2, float var3) {
if(timer == 0) {
timer = 1;
}
this.drawDefaultBackground();
StringTranslate var4 = StringTranslate.getInstance();
if(this.clientHandler == null) {

View File

@ -14,28 +14,11 @@ public class GuiMainMenu extends GuiScreen {
private float updateCounter = 0.0F;
private String splashText = "missingno";
private GuiButton multiplayerButton;
byte[] splash = new byte[] {77, 97, 100, 101, 32, 98, 121, 32, 80, 101, 121, 116, 111, 110, 80, 108, 97, 121, 122, 53, 56, 53, 33};
public GuiMainMenu() {
try {
ArrayList var1 = new ArrayList();
BufferedReader var2 = new BufferedReader(new InputStreamReader(GL11.getResourceAsStream("/title/splashes.txt"), Charset.forName("UTF-8")));
String var3 = "";
while(true) {
var3 = var2.readLine();
if(var3 == null) {
this.splashText = (String)var1.get(rand.nextInt(var1.size()));
break;
}
var3 = var3.trim();
if(var3.length() > 0) {
var1.add(var3);
}
}
} catch (Exception var4) {
}
splashText = new String(splash);
}
public void updateScreen() {

View File

@ -21,13 +21,14 @@ class ThreadConnectToServer {
}
GuiConnecting.getNetClientHandler(this.connectingGui).handleHandshake();
} catch (Exception var4) {
} catch (Throwable var4) {
System.out.println("yee");
if(GuiConnecting.isCancelled(this.connectingGui)) {
return;
}
var4.printStackTrace();
this.mc.displayGuiScreen(new GuiConnectFailed("connect.failed", "disconnect.genericReason", new Object[]{var4.toString()}));
var4.printStackTrace();
}
}