diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ClientListener.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ClientListener.java index ab5d88bfa..7f2dcbb5a 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ClientListener.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ClientListener.java @@ -166,7 +166,7 @@ public void packetReceived(Session session, Packet packet) { public void connected(ConnectedEvent event) { Session session = event.getSession(); MinecraftProtocol protocol = (MinecraftProtocol) session.getPacketProtocol(); - ClientIntentionPacket intention = new ClientIntentionPacket(protocol.getCodec().getProtocolVersion(), event.getSession().getHost(), event.getSession().getPort(), switch (this.targetState) { + ClientIntentionPacket intention = new ClientIntentionPacket(protocol.getCodec().getProtocolVersion(), session.getHost(), session.getPort(), switch (this.targetState) { case LOGIN -> transferring ? HandshakeIntent.TRANSFER : HandshakeIntent.LOGIN; case STATUS -> HandshakeIntent.STATUS; default -> throw new IllegalStateException("Unexpected value: " + this.targetState); diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ServerListener.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ServerListener.java index 1e6e66df3..8a45e12d1 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ServerListener.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ServerListener.java @@ -214,9 +214,9 @@ private void beginLogin(Session session, MinecraftProtocol protocol, ClientInten isTransfer = transferred; session.switchOutboundProtocol(() -> protocol.setOutboundState(ProtocolState.LOGIN)); if (packet.getProtocolVersion() > protocol.getCodec().getProtocolVersion()) { - session.disconnect(Component.translatable("multiplayer.disconnect.incompatible", protocol.getCodec().getMinecraftVersion())); + session.disconnect(Component.translatable("multiplayer.disconnect.incompatible", Component.text(protocol.getCodec().getMinecraftVersion()))); } else if (packet.getProtocolVersion() < protocol.getCodec().getProtocolVersion()) { - session.disconnect(Component.translatable("multiplayer.disconnect.outdated_client", protocol.getCodec().getMinecraftVersion())); + session.disconnect(Component.translatable("multiplayer.disconnect.outdated_client", Component.text(protocol.getCodec().getMinecraftVersion()))); } else { session.switchInboundProtocol(() -> protocol.setInboundState(ProtocolState.LOGIN)); }