Fix handling message in PlayerHandshakeEvent (#7542)

This commit is contained in:
Owen1212055
2022-03-05 15:20:52 -05:00
parent 60d2bdf4a5
commit 97d0234b2f
2 changed files with 3 additions and 12 deletions

View File

@@ -24,9 +24,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (event.callEvent()) {
+ // If we've failed somehow, let the client know so and go no further.
+ if (event.isFailed()) {
+ TranslatableComponent chatmessage = new TranslatableComponent(event.getFailMessage());
+ this.connection.send(new ClientboundLoginDisconnectPacket(chatmessage));
+ this.connection.disconnect(chatmessage);
+ Component component = io.papermc.paper.adventure.PaperAdventure.asVanilla(event.failMessage());
+ this.connection.send(new ClientboundLoginDisconnectPacket(component));
+ this.connection.disconnect(component);
+ return;
+ }
+