3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-16 21:10:30 +01:00

Fix tablist header and footer desync (#1103)

Dieser Commit ist enthalten in:
VelVeV 2024-01-16 22:19:45 +09:00 committet von GitHub
Ursprung f8cdf4fa1a
Commit fe052e5163
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -91,10 +91,9 @@ public class TransitionSessionHandler implements MinecraftSessionHandler {
@Override
public boolean handle(JoinGame packet) {
MinecraftConnection smc = serverConn.ensureConnected();
RegisteredServer previousServer = serverConn.getPreviousServer().orElse(null);
VelocityServerConnection existingConnection = serverConn.getPlayer().getConnectedServer();
final RegisteredServer previousServer = serverConn.getPreviousServer().orElse(null);
final ConnectedPlayer player = serverConn.getPlayer();
final VelocityServerConnection existingConnection = player.getConnectedServer();
if (existingConnection != null) {
// Shut down the existing server connection.
@ -103,11 +102,11 @@ public class TransitionSessionHandler implements MinecraftSessionHandler {
// Send keep alive to try to avoid timeouts
player.sendKeepAlive();
// Reset Tablist header and footer to prevent desync
player.clearPlayerListHeaderAndFooter();
}
// Reset Tablist header and footer to prevent desync
player.clearPlayerListHeaderAndFooter();
// The goods are in hand! We got JoinGame. Let's transition completely to the new state.
smc.setAutoReading(false);
server.getEventManager()