fix voice, added lag warning

This commit is contained in:
LAX1DUDE 2022-07-31 16:25:31 -07:00
parent ddacbb3f50
commit 8ded64ac3e
7 changed files with 42697 additions and 42672 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -235,6 +235,8 @@ public class Minecraft implements Runnable {
public GuiVoiceOverlay voiceOverlay; public GuiVoiceOverlay voiceOverlay;
private int messageOnLoginCounter = 0;
public Minecraft() { public Minecraft() {
this.tempDisplayHeight = 480; this.tempDisplayHeight = 480;
this.fullscreen = false; this.fullscreen = false;
@ -1468,6 +1470,16 @@ public class Minecraft implements Runnable {
this.joinPlayerCounter = 0; this.joinPlayerCounter = 0;
this.theWorld.joinEntityInSurroundings(this.thePlayer); this.theWorld.joinEntityInSurroundings(this.thePlayer);
} }
++messageOnLoginCounter;
if(messageOnLoginCounter == 100 && isSingleplayerOrLAN()) {
displayEaglercraftText(EnumChatFormatting.GREEN + "Notice: chunk loading may take a while in singleplayer.");
}
if(messageOnLoginCounter == 150 && isSingleplayerOrLAN()) {
displayEaglercraftText(EnumChatFormatting.AQUA + "Especially in new worlds, if no chunks show give the game up to 120 seconds before \"giving up\" on a new world");
}
} }
this.mcProfiler.endStartSection("gameRenderer"); this.mcProfiler.endStartSection("gameRenderer");
@ -1624,6 +1636,8 @@ public class Minecraft implements Runnable {
displayEaglercraftText(EnumChatFormatting.LIGHT_PURPLE + "Note: use F+6 to show your coordinates on the screen"); displayEaglercraftText(EnumChatFormatting.LIGHT_PURPLE + "Note: use F+6 to show your coordinates on the screen");
} }
messageOnLoginCounter = 0;
this.thePlayer.preparePlayerToSpawn(); this.thePlayer.preparePlayerToSpawn();
par1WorldClient.spawnEntityInWorld(this.thePlayer); par1WorldClient.spawnEntityInWorld(this.thePlayer);
this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings); this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings);
@ -1881,7 +1895,7 @@ public class Minecraft implements Runnable {
* the integrated one. * the integrated one.
*/ */
public boolean isSingleplayer() { public boolean isSingleplayer() {
return (myNetworkManager instanceof WorkerNetworkManager) && (this.theWorld == null || this.theWorld.playerEntities.size() <= 1); return myNetworkManager instanceof WorkerNetworkManager;
} }
/** /**

View File

@ -1838,7 +1838,7 @@ public class EaglerAdapterImpl2 {
enableVoice(Voice.VoiceChannel.NONE); enableVoice(Voice.VoiceChannel.NONE);
} }
public static final boolean connectionOpen() { public static final boolean connectionOpen() {
if(IntegratedServer.doesChannelExist(EaglerProfile.username)) { if(IntegratedServer.doesChannelExist(EaglerProfile.username) && IntegratedServer.isWorldRunning()) {
return true; return true;
} }
if(sock == null || sock.getReadyState() == 3) { if(sock == null || sock.getReadyState() == 3) {
@ -2307,6 +2307,7 @@ public class EaglerAdapterImpl2 {
voiceGains.put(peerId, gain); voiceGains.put(peerId, gain);
voicePanners.put(peerId, panner); voicePanners.put(peerId, panner);
} }
if(mutedSet.contains(peerId)) voiceClient.mutePeer(peerId, true);
} }
}); });
voiceClient.setPeerDisconnectHandler(new EaglercraftVoiceClient.PeerDisconnectHandler() { voiceClient.setPeerDisconnectHandler(new EaglercraftVoiceClient.PeerDisconnectHandler() {