Update #44 - WebAssembly GC support, fix more WebRTC bugs

This commit is contained in:
lax1dude
2024-12-03 23:38:28 -08:00
parent 919014b4df
commit 70b52bbf7a
216 changed files with 34358 additions and 91 deletions

View File

@ -18,7 +18,7 @@
> DELETE 1 @ 1 : 4
> CHANGE 1 : 74 @ 1 : 4
> CHANGE 1 : 75 @ 1 : 4
~
~ import net.lax1dude.eaglercraft.v1_8.ClientUUIDLoadingCache;
@ -52,6 +52,7 @@
~ import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerFontRenderer;
~ import net.lax1dude.eaglercraft.v1_8.minecraft.EnumInputEvent;
~ import net.lax1dude.eaglercraft.v1_8.minecraft.GuiScreenGenericErrorMessage;
~ import net.lax1dude.eaglercraft.v1_8.minecraft.GuiScreenVSyncReEnabled;
~ import net.lax1dude.eaglercraft.v1_8.minecraft.GuiScreenVideoSettingsWarning;
~ import net.lax1dude.eaglercraft.v1_8.notifications.ServerNotificationRenderer;
~ import net.lax1dude.eaglercraft.v1_8.opengl.EaglerMeshLoader;
@ -359,12 +360,6 @@
~ mainMenu = new GuiConnecting(mainMenu, this, this.serverName, this.serverPort);
> CHANGE 2 : 5 @ 2 : 7
~ int vidIssues = gameSettings.checkBadVideoSettings();
~ if (vidIssues != 0) {
~ mainMenu = new GuiScreenVideoSettingsWarning(mainMenu, vidIssues);
> CHANGE 2 : 6 @ 2 : 7
~ mainMenu = new GuiScreenEditProfile(mainMenu);
@ -372,8 +367,25 @@
~ if (!EagRuntime.getConfiguration().isForceProfanityFilter() && !gameSettings.hasShownProfanityFilter) {
~ mainMenu = new GuiScreenContentWarning(mainMenu);
> CHANGE 2 : 14 @ 2 : 3
> CHANGE 2 : 7 @ 2 : 7
~ boolean vsyncScreen = false;
~ if (EagRuntime.getConfiguration().isEnforceVSync() && Display.isVSyncSupported() && !gameSettings.enableVsync) {
~ gameSettings.enableVsync = true;
~ gameSettings.saveOptions();
~ vsyncScreen = true;
> CHANGE 2 : 23 @ 2 : 3
~ int vidIssues = gameSettings.checkBadVideoSettings();
~ if (vidIssues != 0) {
~ mainMenu = new GuiScreenVideoSettingsWarning(mainMenu, vidIssues);
~ }
~
~ if (vsyncScreen) {
~ mainMenu = new GuiScreenVSyncReEnabled(mainMenu);
~ }
~
~ this.displayGuiScreen(mainMenu);
~
~ this.renderEngine.deleteTexture(this.mojangLogo);

View File

@ -345,7 +345,7 @@
> CHANGE 8 : 36 @ 8 : 25
~ ArrayList arraylist;
~ if (EagRuntime.getPlatformType() != EnumPlatformType.JAVASCRIPT) {
~ if (EagRuntime.getPlatformType() == EnumPlatformType.DESKTOP) {
~ long i = EagRuntime.maxMemory();
~ long j = EagRuntime.totalMemory();
~ long k = EagRuntime.freeMemory();

View File

@ -85,7 +85,7 @@
+ long millis = EagRuntime.steadyTimeMillis();
+ long closeKeyTimeout = millis - showingCloseKey;
+ if (closeKeyTimeout < 3000l) {
+ if (closeKeyTimeout < 3000l && showingCloseKey != 0l) {
+ int alpha1 = 0xC0000000;
+ int alpha2 = 0xFF000000;
+ if (closeKeyTimeout > 2500l) {

View File

@ -168,7 +168,154 @@
> DELETE 3 @ 3 : 4
> DELETE 105 @ 105 : 106
> CHANGE 3 : 7 @ 3 : 5
~ Entity object = null;
~ boolean b = false;
~ switch (packetIn.getType()) {
~ case 10:
> CHANGE 2 : 5 @ 2 : 3
~ break;
~ case 90:
~ b = true;
> CHANGE 4 : 6 @ 4 : 7
~ break;
~ case 60:
> CHANGE 1 : 3 @ 1 : 2
~ break;
~ case 61:
> CHANGE 1 : 4 @ 1 : 2
~ break;
~ case 71:
~ b = true;
> CHANGE 3 : 6 @ 3 : 5
~ break;
~ case 77:
~ b = true;
> CHANGE 2 : 4 @ 2 : 4
~ break;
~ case 65:
> CHANGE 1 : 3 @ 1 : 2
~ break;
~ case 72:
> CHANGE 1 : 3 @ 1 : 2
~ break;
~ case 76:
> CHANGE 1 : 4 @ 1 : 2
~ break;
~ case 63:
~ b = true;
> CHANGE 3 : 6 @ 3 : 5
~ break;
~ case 64:
~ b = true;
> CHANGE 3 : 6 @ 3 : 5
~ break;
~ case 66:
~ b = true;
> CHANGE 3 : 5 @ 3 : 5
~ break;
~ case 62:
> CHANGE 1 : 4 @ 1 : 2
~ break;
~ case 73:
~ b = true;
> CHANGE 1 : 4 @ 1 : 3
~ break;
~ case 75:
~ b = true;
> CHANGE 1 : 3 @ 1 : 3
~ break;
~ case 1:
> CHANGE 1 : 3 @ 1 : 2
~ break;
~ case 50:
> CHANGE 1 : 3 @ 1 : 2
~ break;
~ case 78:
> CHANGE 1 : 3 @ 1 : 2
~ break;
~ case 51:
> CHANGE 1 : 3 @ 1 : 2
~ break;
~ case 2:
> CHANGE 1 : 4 @ 1 : 2
~ break;
~ case 70:
~ b = true;
> INSERT 2 : 7 @ 2
+ break;
+ }
+
+ if (b) {
+ // fix for compiler bug
> CHANGE 4 : 10 @ 4 : 10
~ object.serverPosX = packetIn.getX();
~ object.serverPosY = packetIn.getY();
~ object.serverPosZ = packetIn.getZ();
~ object.rotationPitch = (float) (packetIn.getPitch() * 360) / 256.0F;
~ object.rotationYaw = (float) (packetIn.getYaw() * 360) / 256.0F;
~ Entity[] aentity = object.getParts();
> CHANGE 1 : 2 @ 1 : 2
~ int i = packetIn.getEntityID() - object.getEntityId();
> CHANGE 6 : 8 @ 6 : 8
~ object.setEntityId(packetIn.getEntityID());
~ this.clientWorldController.addEntityToWorld(packetIn.getEntityID(), object);
> CHANGE 8 : 10 @ 8 : 10
~ object.setVelocity((double) packetIn.getSpeedX() / 8000.0D, (double) packetIn.getSpeedY() / 8000.0D,
~ (double) packetIn.getSpeedZ() / 8000.0D);
> DELETE 6 @ 6 : 7
> DELETE 12 @ 12 : 13

View File

@ -18,7 +18,39 @@
~ public void renderBlockDamage(IBlockState state, BlockPos pos, EaglerTextureAtlasSprite texture,
> CHANGE 55 : 59 @ 55 : 61
> INSERT 15 : 16 @ 15
+ boolean res;
> CHANGE 2 : 3 @ 2 : 3
~ res = false;
> CHANGE 3 : 5 @ 3 : 4
~ res = this.fluidRenderer.renderFluid(blockAccess, state, pos, worldRendererIn);
~ break;
> CHANGE 1 : 3 @ 1 : 2
~ res = false;
~ break;
> CHANGE 2 : 4 @ 2 : 3
~ res = this.blockModelRenderer.renderModel(blockAccess, ibakedmodel, state, pos, worldRendererIn);
~ break;
> CHANGE 1 : 3 @ 1 : 2
~ res = false;
~ break;
> INSERT 2 : 3 @ 2
+ return res;
> CHANGE 24 : 28 @ 24 : 30
~
~ try {

View File

@ -26,13 +26,19 @@
~ private String[] stacktrace;
> INSERT 4 : 5 @ 4
> INSERT 2 : 5 @ 2
+ if (causeThrowable == null) {
+ throw new NullPointerException("Crash report created for null throwable!");
+ }
> INSERT 2 : 3 @ 2
+ this.stacktrace = EagRuntime.getStackTraceElements(causeThrowable);
> CHANGE 26 : 37 @ 26 : 54
~ if (EagRuntime.getPlatformType() != EnumPlatformType.JAVASCRIPT) {
~ if (EagRuntime.getPlatformType() == EnumPlatformType.DESKTOP) {
~ this.theReportCategory.addCrashSectionCallable("Memory", new Callable<String>() {
~ public String call() {
~ long i = EagRuntime.maxMemory();

View File

@ -7,12 +7,14 @@
> DELETE 2 @ 2 : 4
> CHANGE 4 : 11 @ 4 : 8
> CHANGE 4 : 13 @ 4 : 8
~
~ import com.google.common.collect.Lists;
~ import com.google.common.collect.Maps;
~
~ import net.lax1dude.eaglercraft.v1_8.EagRuntime;
~ import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformType;
~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
~ import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
~ import net.lax1dude.eaglercraft.v1_8.minecraft.EntityConstructor;
@ -126,7 +128,22 @@
~ Set<String> set = stringToClassMapping.keySet();
> CHANGE 29 : 97 @ 29 : 91
> CHANGE 2 : 9 @ 2 : 6
~ // TODO: Eventually TeaVM will support getModifiers
~ if (EagRuntime.getPlatformType() != EnumPlatformType.WASM_GC) {
~ for (String s : set) {
~ Class oclass = (Class) stringToClassMapping.get(s);
~ if ((oclass.getModifiers() & 1024) != 1024) {
~ arraylist.add(s);
~ }
> INSERT 1 : 3 @ 1
+ } else {
+ arraylist.addAll(set);
> CHANGE 22 : 90 @ 22 : 84
~ addMapping(EntityItem.class, EntityItem::new, "Item", 1);
~ addMapping(EntityXPOrb.class, EntityXPOrb::new, "XPOrb", 2);

View File

@ -38,7 +38,9 @@
> DELETE 7 @ 7 : 8
> CHANGE 10 : 11 @ 10 : 12
> DELETE 4 @ 4 : 5
> CHANGE 5 : 6 @ 5 : 7
~ import net.minecraft.world.chunk.Chunk;
@ -195,7 +197,11 @@
~ for (int i = 0; i < this.worldServers.length; ++i) {
~ WorldServer worldserver = this.worldServers[i];
> DELETE 20 @ 20 : 23
> CHANGE 6 : 7 @ 6 : 11
~ worldserver.saveAllChunks(true, (IProgressUpdate) null);
> DELETE 9 @ 9 : 12
> CHANGE 16 : 22 @ 16 : 21

View File

@ -314,7 +314,9 @@
~ public EntityPlayer getPlayerEntityByUUID(EaglercraftUUID uuid) {
> CHANGE 197 : 198 @ 197 : 198
> DELETE 13 @ 13 : 17
> CHANGE 180 : 181 @ 180 : 181
~ public EaglercraftRandom setRandomSeed(int parInt1, int parInt2, int parInt3) {

View File

@ -108,13 +108,21 @@
~ EaglercraftRandom random = new EaglercraftRandom(this.getSeed());
> CHANGE 62 : 65 @ 62 : 63
> CHANGE 49 : 50 @ 49 : 50
~ public void saveAllChunks(boolean progressCallback, IProgressUpdate parIProgressUpdate) {
> CHANGE 12 : 15 @ 12 : 13
~ List<Chunk> lst = Lists.newArrayList(this.theChunkProviderServer.func_152380_a());
~ for (int i = 0, l = lst.size(); i < l; ++i) {
~ Chunk chunk = lst.get(i);
> CHANGE 79 : 82 @ 79 : 80
> CHANGE 14 : 15 @ 14 : 16
~ protected void saveLevel() {
> CHANGE 63 : 66 @ 63 : 64
~ List<EntityPlayer> lst = this.playerEntities;
~ for (int i = 0, l = lst.size(); i < l; ++i) {

View File

@ -14,4 +14,6 @@
~ public WorldServerMulti(MinecraftServer server, ISaveHandler saveHandlerIn, int dimensionId, WorldServer delegate) {
~ super(server, saveHandlerIn, new DerivedWorldInfo(delegate.getWorldInfo()), dimensionId);
> DELETE 32 @ 32 : 35
> EOF

View File

@ -0,0 +1,14 @@
# Eagler Context Redacted Diff
# Copyright (c) 2024 lax1dude. All rights reserved.
# Version: 1.0
# Author: lax1dude
> DELETE 3 @ 3 : 4
> CHANGE 6 : 7 @ 6 : 7
~ void saveChunk(World var1, Chunk var2) throws IOException;
> EOF

View File

@ -9,7 +9,9 @@
+ import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerMinecraftServer;
> CHANGE 14 : 17 @ 14 : 16
> DELETE 6 @ 6 : 7
> CHANGE 7 : 10 @ 7 : 9
~ import net.lax1dude.eaglercraft.v1_8.HString;
~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
@ -46,17 +48,14 @@
+ ++EaglerMinecraftServer.counterChunkWrite;
> CHANGE 1 : 3 @ 1 : 2
> CHANGE 1 : 3 @ 1 : 5
~ logger.error("Couldn\'t save chunk");
~ logger.error(ioexception);
> CHANGE 1 : 3 @ 1 : 3
> DELETE 1 @ 1 : 2
~ logger.error("Couldn\'t save chunk; already in use by another instance of Minecraft?");
~ logger.error(minecraftexception);
> CHANGE 31 : 32 @ 31 : 32
> CHANGE 29 : 30 @ 29 : 30
~ for (int j = 0, l = arraylist.size(); j < l; ++j) {

View File

@ -7,13 +7,15 @@
> DELETE 2 @ 2 : 3
> INSERT 1 : 2 @ 1
> CHANGE 1 : 2 @ 1 : 2
+ import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2;
~ import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2;
> DELETE 3 @ 3 : 5
> DELETE 2 @ 2 : 4
> CHANGE 16 : 17 @ 16 : 17
> DELETE 4 @ 4 : 6
> CHANGE 10 : 11 @ 10 : 11
~ VFile2 getWorldDirectory();

View File

@ -12,7 +12,9 @@
~ import java.util.List;
~
> CHANGE 7 : 11 @ 7 : 12
> DELETE 4 @ 4 : 5
> CHANGE 2 : 6 @ 2 : 7
~ import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2;
~ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
@ -40,9 +42,9 @@
~ public VFile2 getWorldDirectory() {
> DELETE 4 @ 4 : 19
> DELETE 3 @ 3 : 21
> CHANGE 3 : 4 @ 3 : 4
> CHANGE 1 : 2 @ 1 : 2
~ throw new RuntimeException("eagler");

View File

@ -9,9 +9,11 @@
~ import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFile2;
> DELETE 4 @ 4 : 7
> DELETE 1 @ 1 : 2
> DELETE 9 @ 9 : 13
> DELETE 2 @ 2 : 5
> DELETE 6 @ 6 : 13
> CHANGE 13 : 19 @ 13 : 14