Skip to content

Commit

Permalink
fix double disconnect if trying to connect directly to server
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonic2423 committed Aug 27, 2024
1 parent 856c6ca commit d4d83c5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ public void handleHello(ServerboundHelloPacket pPacket, CallbackInfo ci) {
private void onHandleCustomQueryPacket(ServerboundCustomQueryAnswerPacket packet, CallbackInfo ci) {
if (Config.enableForwarding && packet.transactionId() == this.neoforwarding$velocityLoginMessageId) {

ci.cancel();

if (packet.payload() == null) {
this.disconnect(Component.literal("This server requires you to connect with Velocity."));
return;
Expand Down Expand Up @@ -98,8 +100,6 @@ private void onHandleCustomQueryPacket(ServerboundCustomQueryAnswerPacket packet
startClientVerification(PlayerDataForwarding.createProfile(buf));

NeoForwarding.LOGGER.info("UUID of player {} is {}", this.authenticatedProfile.getName(), this.authenticatedProfile.getId());

ci.cancel();
}
}
}

0 comments on commit d4d83c5

Please sign in to comment.