Skip to content

Commit

Permalink
Fix java disconnect message
Browse files Browse the repository at this point in the history
  • Loading branch information
rtm516 committed Jul 16, 2024
1 parent 110b66f commit 5f4f65d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ public void sendMessage(String message) {

@Override
public void disconnect(String reason) {
session.send(new ClientboundLoginDisconnectPacket(jsonFormatMessage(reason)));
session.disconnect(reason);
session.send(new ClientboundLoginDisconnectPacket(LEGACY_SERIALIZER.deserialize(reason)));
session.disconnect(LEGACY_SERIALIZER.deserialize(reason));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,4 @@ default void sendJoinMessages() {
default String formatMessage(String message) {
return message.replace("&", "§");
}

default String jsonFormatMessage(String message) {
return "{\"text\": \"" + formatMessage(message) + "\"}";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public JavaPlayer addJavaPlayer(Session session, GameProfile gameProfile) {
old.disconnect("You logged in from somewhere else");
}

player.disconnect("&aYou are now successfully linked! :)");

return player;
}

Expand Down

0 comments on commit 5f4f65d

Please sign in to comment.