From a07883f25aecdfffddaaca9a74b1126bfa250505 Mon Sep 17 00:00:00 2001 From: LAX1DUDE Date: Mon, 16 May 2022 21:38:34 -0700 Subject: [PATCH] changed F+6 message, revert minor lag fix --- .../lax1dude/eaglercraft/ConfigConstants.java | 2 +- .../java/net/minecraft/client/Minecraft.java | 16 ++++++++-------- .../java/net/minecraft/src/GameSettings.java | 2 +- src/main/java/net/minecraft/src/GuiIngame.java | 4 ---- .../eaglercraft/adapter/EaglerAdapterImpl2.java | 17 ----------------- 5 files changed, 10 insertions(+), 31 deletions(-) diff --git a/src/main/java/net/lax1dude/eaglercraft/ConfigConstants.java b/src/main/java/net/lax1dude/eaglercraft/ConfigConstants.java index 27b9dcb..ed19865 100644 --- a/src/main/java/net/lax1dude/eaglercraft/ConfigConstants.java +++ b/src/main/java/net/lax1dude/eaglercraft/ConfigConstants.java @@ -4,7 +4,7 @@ public class ConfigConstants { public static boolean profanity = false; - public static final String version = "22w20a"; + public static final String version = "22w20b"; public static final String mainMenuString = "eaglercraft " + version; public static final String forkMe = "https://github.com/LAX1DUDE/eaglercraft"; diff --git a/src/main/java/net/minecraft/client/Minecraft.java b/src/main/java/net/minecraft/client/Minecraft.java index aca9f49..efcfe71 100644 --- a/src/main/java/net/minecraft/client/Minecraft.java +++ b/src/main/java/net/minecraft/client/Minecraft.java @@ -157,8 +157,6 @@ public class Minecraft implements Runnable { int fpsCounter = 0; long prevFrameTime = -1L; - public int showHints = 140; - long secondTimer = 0l; private HashSet shownPlayerMessages = new HashSet(); @@ -952,7 +950,7 @@ public class Minecraft implements Runnable { public void displayEaglercraftText(String s) { if(this.thePlayer != null && shownPlayerMessages.add(s)) { - this.thePlayer.sendChatToPlayer("notice: "+s); + this.thePlayer.sendChatToPlayer(s); } } @@ -1342,10 +1340,6 @@ public class Minecraft implements Runnable { this.joinPlayerCounter = 0; this.theWorld.joinEntityInSurroundings(this.thePlayer); } - - if(this.showHints > 0) { - --this.showHints; - } } this.mcProfiler.endStartSection("gameRenderer"); @@ -1488,7 +1482,13 @@ public class Minecraft implements Runnable { StringTranslate var4 = StringTranslate.getInstance(); if(!this.gameSettings.fancyGraphics || this.gameSettings.ambientOcclusion == 0) { - displayEaglercraftText(var4.translateKey("fancyGraphicsNote")); + displayEaglercraftText("Note: " + var4.translateKey("fancyGraphicsNote")); + } + + if(this.gameSettings.showCoordinates) { + displayEaglercraftText(EnumChatFormatting.LIGHT_PURPLE + "Note: use F+6 to hide the coordinates off of the screen (if you're in public)"); + }else { + displayEaglercraftText(EnumChatFormatting.LIGHT_PURPLE + "Note: use F+6 to show your coordinates on the screen"); } this.thePlayer.preparePlayerToSpawn(); diff --git a/src/main/java/net/minecraft/src/GameSettings.java b/src/main/java/net/minecraft/src/GameSettings.java index 7c6c805..fc5f3a1 100644 --- a/src/main/java/net/minecraft/src/GameSettings.java +++ b/src/main/java/net/minecraft/src/GameSettings.java @@ -133,7 +133,7 @@ public class GameSettings { this.thirdPersonView = 0; this.showDebugInfo = false; this.showDebugProfilerChart = true; - this.showCoordinates = false; + this.showCoordinates = true; this.lastServer = ""; this.noclip = false; this.smoothCamera = false; diff --git a/src/main/java/net/minecraft/src/GuiIngame.java b/src/main/java/net/minecraft/src/GuiIngame.java index 5a402f7..953621d 100644 --- a/src/main/java/net/minecraft/src/GuiIngame.java +++ b/src/main/java/net/minecraft/src/GuiIngame.java @@ -462,10 +462,6 @@ public class GuiIngame extends Gui { if(mc.gameSettings.showCoordinates) { var8.drawStringWithShadow("x: "+MathHelper.floor_double(this.mc.thePlayer.posX)+", y: "+MathHelper.floor_double(this.mc.thePlayer.posY)+", z: "+MathHelper.floor_double(this.mc.thePlayer.posZ), 2, 12, 16777215); - }else { - if(mc.showHints > 0) { - var8.drawStringWithShadow("Press F+6 to show coordinates", 2, 12, 16777215); - } } int offset = this.mc.isChatOpen() ? 135 : 0; diff --git a/src/teavm/java/net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java b/src/teavm/java/net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java index 3c45ee3..087c9dd 100644 --- a/src/teavm/java/net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java +++ b/src/teavm/java/net/lax1dude/eaglercraft/adapter/EaglerAdapterImpl2.java @@ -1548,20 +1548,6 @@ public class EaglerAdapterImpl2 { return false; } - @Async - private static native Object interrupt(); - - private static void interrupt(final AsyncCallback cb) { - Window.setTimeout(new TimerHandler() { - - @Override - public void onTimer() { - cb.complete(null); - } - - }, 0); - } - @JSBody(params = { "obj" }, script = "if(obj.commit) obj.commit();") private static native int commitContext(JSObject obj); @@ -1582,14 +1568,11 @@ public class EaglerAdapterImpl2 { if(renderingCanvas.getHeight() != h) { renderingCanvas.setHeight(h); } - /* try { Thread.sleep(1l); } catch (InterruptedException e) { ; } - */ - interrupt(); } public static final void setVSyncEnabled(boolean p1) {