diff --git a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java index 224f231b6..2d365c39d 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java @@ -904,7 +904,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection public CompletableFuture sendData(String channel, byte[] data) { Preconditions.checkState( getVersion() >= ProtocolConstants.MINECRAFT_1_13, "LoginPayloads are only supported in 1.13 and above" ); - Preconditions.checkState( loginRequest != null, "Cannot send login data for status or legacy connections" ); + Preconditions.checkState( ch.getEncodeProtocol() == Protocol.LOGIN, "LoginPayloads are only supported in the login phase" ); CompletableFuture future = new CompletableFuture<>(); final int id; diff --git a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java index c9e3697e7..49967de9d 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java @@ -36,6 +36,7 @@ import net.md_5.bungee.protocol.packet.CookieResponse; import net.md_5.bungee.protocol.packet.FinishConfiguration; import net.md_5.bungee.protocol.packet.KeepAlive; import net.md_5.bungee.protocol.packet.LoginAcknowledged; +import net.md_5.bungee.protocol.packet.LoginPayloadResponse; import net.md_5.bungee.protocol.packet.PlayerListItem; import net.md_5.bungee.protocol.packet.PlayerListItemRemove; import net.md_5.bungee.protocol.packet.PluginMessage; @@ -378,6 +379,12 @@ public class UpstreamBridge extends PacketHandler con.getPendingConnection().handle( cookieResponse ); } + @Override + public void handle(LoginPayloadResponse loginPayloadResponse) throws Exception + { + con.getPendingConnection().handle( loginPayloadResponse ); + } + @Override public String toString() {