Pass the correct virtual host port during the handshake (#1205)

This commit is contained in:
Adrian
2024-01-20 07:27:41 -05:00
committed by GitHub
parent d4a661870e
commit 46d018c0f2

View File

@@ -176,9 +176,9 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
// Initiate the handshake.
ProtocolVersion protocolVersion = proxyPlayer.getConnection().getProtocolVersion();
String playerVhost =
proxyPlayer.getVirtualHost().orElseGet(() -> registeredServer.getServerInfo().getAddress())
.getHostString();
String playerVhost = proxyPlayer.getVirtualHost()
.orElseGet(() -> registeredServer.getServerInfo().getAddress())
.getHostString();
HandshakePacket handshake = new HandshakePacket();
handshake.setNextStatus(StateRegistry.LOGIN_ID);
@@ -197,7 +197,9 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
handshake.setServerAddress(playerVhost);
}
handshake.setPort(registeredServer.getServerInfo().getAddress().getPort());
handshake.setPort(proxyPlayer.getVirtualHost()
.orElseGet(() -> registeredServer.getServerInfo().getAddress())
.getPort());
mc.delayedWrite(handshake);
mc.setProtocolVersion(protocolVersion);