Preserve virtual host the player connected to for modern/none forwarding

This makes these modes in-line with legacy forwarding
This commit is contained in:
Andrew Steinborn 2021-09-25 17:51:58 -04:00
parent ea07c6661a
commit effca0da82

View File

@ -173,7 +173,9 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
} else if (proxyPlayer.getConnection().getType() == ConnectionTypes.LEGACY_FORGE) {
handshake.setServerAddress(destAddress.getHostString() + HANDSHAKE_HOSTNAME_TOKEN);
} else {
handshake.setServerAddress(destAddress.getHostString());
handshake.setServerAddress(proxyPlayer.getVirtualHost()
.orElseGet(() -> registeredServer.getServerInfo().getAddress())
.getHostString());
}
handshake.setPort(destAddress.getPort());
mc.delayedWrite(handshake);