diff --git a/src/main/java/org/geysermc/globallinkserver/java/JavaPlayer.java b/src/main/java/org/geysermc/globallinkserver/java/JavaPlayer.java index 9f95987..81d9dea 100644 --- a/src/main/java/org/geysermc/globallinkserver/java/JavaPlayer.java +++ b/src/main/java/org/geysermc/globallinkserver/java/JavaPlayer.java @@ -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 diff --git a/src/main/java/org/geysermc/globallinkserver/player/Player.java b/src/main/java/org/geysermc/globallinkserver/player/Player.java index 5689343..5d31cf9 100644 --- a/src/main/java/org/geysermc/globallinkserver/player/Player.java +++ b/src/main/java/org/geysermc/globallinkserver/player/Player.java @@ -48,8 +48,4 @@ default void sendJoinMessages() { default String formatMessage(String message) { return message.replace("&", "ยง"); } - - default String jsonFormatMessage(String message) { - return "{\"text\": \"" + formatMessage(message) + "\"}"; - } } diff --git a/src/main/java/org/geysermc/globallinkserver/player/PlayerManager.java b/src/main/java/org/geysermc/globallinkserver/player/PlayerManager.java index 5813113..efff583 100644 --- a/src/main/java/org/geysermc/globallinkserver/player/PlayerManager.java +++ b/src/main/java/org/geysermc/globallinkserver/player/PlayerManager.java @@ -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; }