fix: transfer state never actually getting sent to the server

since we are making a new Session once we reconnect, and we also didn't migrate the old flags, setting CLIENT_TRANSFERRING to true doesn't mean anything
This commit is contained in:
Chayapak 2025-03-26 15:29:55 +07:00
parent dd629d1dfa
commit d9e22906ef
Signed by: ChomeNS
SSH key fingerprint: SHA256:0YoxhdyXsgbc0nfeB2N6FYE60mxMU7DS4uCUMaw2mvA
2 changed files with 6 additions and 6 deletions
build-number.txt
src/main/java/me/chayapak1/chomens_bot

View file

@ -1 +1 @@
2215
2216

View file

@ -194,6 +194,11 @@ public class Bot extends SessionAdapter {
this.session = session;
// this is still needed since MinecraftProtocol will use this flag to set the
// handshake intention to transfer, it will be set back to false at
// login success
session.setFlag(BuiltinFlags.CLIENT_TRANSFERRING, isTransferring);
session.setFlag(MinecraftConstants.FOLLOW_TRANSFERS, false); // we have our own transfer handler
session.setFlag(BuiltinFlags.ATTEMPT_SRV_RESOLVE, options.resolveSRV);
@ -274,11 +279,6 @@ public class Bot extends SessionAdapter {
public void packetReceived (ClientboundTransferPacket ignoredPacket) {
this.isTransferring = true;
// this is still needed since MinecraftProtocol will use this flag to set the
// handshake intention to transfer, it will be set back to false at
// login success
session.setFlag(BuiltinFlags.CLIENT_TRANSFERRING, true);
session.disconnect(Component.translatable("disconnect.transfer"));
}