This commit is contained in:
eaglercraft
2024-05-18 23:52:27 -07:00
parent ddc90126af
commit f89f7486f5
50 changed files with 753 additions and 440 deletions

View File

@@ -21,6 +21,7 @@ import com.google.common.collect.Lists;
import net.lax1dude.eaglercraft.v1_8.Display;
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.EagUtils;
import net.lax1dude.eaglercraft.v1_8.EaglerXBungeeVersion;
import net.lax1dude.eaglercraft.v1_8.HString;
import net.lax1dude.eaglercraft.v1_8.IOUtils;
@@ -788,7 +789,17 @@ public class Minecraft implements IThreadListener {
long l = System.nanoTime();
this.mcProfiler.startSection("tick");
for (int j = 0; j < this.timer.elapsedTicks; ++j) {
if (this.timer.elapsedTicks > 1) {
long watchdog = System.currentTimeMillis();
for (int j = 0; j < this.timer.elapsedTicks; ++j) {
this.runTick();
long millis = System.currentTimeMillis();
if (millis - watchdog > 50l) {
watchdog = millis;
EagUtils.sleep(0l);
}
}
} else if (this.timer.elapsedTicks == 1) {
this.runTick();
}
@@ -876,7 +887,11 @@ public class Minecraft implements IThreadListener {
public void updateDisplay() {
this.mcProfiler.startSection("display_update");
Display.setVSync(this.gameSettings.enableVsync);
if (Display.isVSyncSupported()) {
Display.setVSync(this.gameSettings.enableVsync);
} else {
this.gameSettings.enableVsync = false;
}
Display.update();
this.mcProfiler.endSection();
this.checkWindowResize();