From b88c573eb11839a95bea1af947b0c59a5956368b Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Mon, 1 Feb 2021 16:17:02 -0500 Subject: [PATCH] Correctly forward the player's virtual host to the remote server. --- .../proxy/connection/backend/VelocityServerConnection.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/VelocityServerConnection.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/VelocityServerConnection.java index 93958663e..cf70bf5ad 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/VelocityServerConnection.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/VelocityServerConnection.java @@ -101,7 +101,9 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation, // separated by \0 (the null byte). In order, you send the original host, the player's IP, their // UUID (undashed), and if you are in online-mode, their login properties (from Mojang). StringBuilder data = new StringBuilder() - .append(registeredServer.getServerInfo().getAddress().getHostString()) + .append(proxyPlayer.getVirtualHost() + .orElseGet(() -> registeredServer.getServerInfo().getAddress()) + .getHostString()) .append('\0') .append(proxyPlayer.getRemoteAddress().getHostString()) .append('\0')