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;
private int messageOnLoginCounter = 0;
public Minecraft() {
this.tempDisplayHeight = 480;
this.fullscreen = false;
@ -1468,6 +1470,16 @@ public class Minecraft implements Runnable {
this.joinPlayerCounter = 0;
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");
@ -1623,6 +1635,8 @@ public class Minecraft implements Runnable {
}else {
displayEaglercraftText(EnumChatFormatting.LIGHT_PURPLE + "Note: use F+6 to show your coordinates on the screen");
}
messageOnLoginCounter = 0;
this.thePlayer.preparePlayerToSpawn();
par1WorldClient.spawnEntityInWorld(this.thePlayer);
@ -1881,7 +1895,7 @@ public class Minecraft implements Runnable {
* the integrated one.
*/
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);
}
public static final boolean connectionOpen() {
if(IntegratedServer.doesChannelExist(EaglerProfile.username)) {
if(IntegratedServer.doesChannelExist(EaglerProfile.username) && IntegratedServer.isWorldRunning()) {
return true;
}
if(sock == null || sock.getReadyState() == 3) {
@ -2307,6 +2307,7 @@ public class EaglerAdapterImpl2 {
voiceGains.put(peerId, gain);
voicePanners.put(peerId, panner);
}
if(mutedSet.contains(peerId)) voiceClient.mutePeer(peerId, true);
}
});
voiceClient.setPeerDisconnectHandler(new EaglercraftVoiceClient.PeerDisconnectHandler() {