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();

View File

@@ -49,6 +49,7 @@ import net.minecraft.util.ResourceLocation;
*/
public class SoundHandler implements IResourceManagerReloadListener, ITickable {
private static final Logger logger = LogManager.getLogger();
private static final Logger tipLogger = LogManager.getLogger("EaglercraftX");
public static final SoundPoolEntry missing_sound = new SoundPoolEntry(new ResourceLocation("meta:missing_sound"),
0.0D, 0.0D, false);
private final SoundRegistry sndRegistry = new SoundRegistry();
@@ -83,6 +84,10 @@ public class SoundHandler implements IResourceManagerReloadListener, ITickable {
}
}
if (this.sndRegistry.getObject(new ResourceLocation("minecraft:sounds/music/game/calm1.ogg")) == null) {
tipLogger.info(
"Download this resource pack if you want music: https://bafybeiayojww5jfyzvlmtuk7l5ufkt7nlfto7mhwmzf2vs4bvsjd5ouiuq.ipfs.nftstorage.link/?filename=Music_For_Eaglercraft.zip");
}
}
public static class SoundMap {

View File

@@ -4,6 +4,7 @@ import java.util.Map;
import com.google.common.collect.Maps;
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.OpenGlHelper;
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
@@ -218,8 +219,12 @@ public class RenderManager {
this.skinMap.put("default", this.playerRenderer);
this.skinMap.put("slim", new RenderPlayer(this, true, false));
this.skinMap.put("zombie", new RenderPlayer(this, false, true));
this.eaglerRenderer = new RenderHighPoly(this, this.playerRenderer.getMainModel(),
this.playerRenderer.shadowSize);
if (EagRuntime.getConfiguration().isAllowFNAWSkins()) {
this.eaglerRenderer = new RenderHighPoly(this, this.playerRenderer.getMainModel(),
this.playerRenderer.shadowSize);
} else {
this.eaglerRenderer = this.playerRenderer;
}
this.skinMap.put("eagler",
Minecraft.getMinecraft().gameSettings.enableFNAWSkins ? this.eaglerRenderer : this.playerRenderer);
}