diff --git a/src/main/java/com/github/dirtpowered/releasetobeta/network/translator/moderntobeta/B_1_7/LoginStartTranslator.java b/src/main/java/com/github/dirtpowered/releasetobeta/network/translator/moderntobeta/B_1_7/LoginStartTranslator.java index b1c5789..5026dbf 100644 --- a/src/main/java/com/github/dirtpowered/releasetobeta/network/translator/moderntobeta/B_1_7/LoginStartTranslator.java +++ b/src/main/java/com/github/dirtpowered/releasetobeta/network/translator/moderntobeta/B_1_7/LoginStartTranslator.java @@ -42,12 +42,18 @@ public void translate(ReleaseToBeta main, LoginStartPacket packet, Session moder if (betaSession.getProtocolState() != ProtocolState.LOGIN) return; - boolean flag = R2BConfiguration.ipForwarding; + int header = 1; + long address = 0; + if(R2BConfiguration.ipForwarding) { + InetSocketAddress socketAddress = (InetSocketAddress) modernSession.getRemoteAddress(); + address = serializeAddress(socketAddress.getAddress().getHostAddress()); + if(R2BConfiguration.onlineMode) { + header = 26; + } else { + header = 25; + } - InetSocketAddress socketAddress = (InetSocketAddress) modernSession.getRemoteAddress(); - - long address = flag ? serializeAddress(socketAddress.getAddress().getHostAddress()) : 0; - byte header = (byte) (flag ? -999 : 1); + } betaSession.getPlayer().fillProfile(username, result -> { betaSession.sendPacket(new HandshakePacketData(username));