Skip to content

Commit

Permalink
fix(spigot): players not being unregistered if kicked during login
Browse files Browse the repository at this point in the history
  • Loading branch information
diogotcorreia committed Jan 14, 2024
1 parent 09d2690 commit 855629b
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public void onLogin(AsyncPlayerPreLoginEvent loginEvent) {
.translateString(loginEvent.getKickMessage(), languagePlayer, Triton.get().getConfig().getKickSyntax())
.ifChanged(loginEvent::setKickMessage)
.ifUnchanged(() -> loginEvent.setKickMessage(""));
// Unregister the player, otherwise their language will stay (perhaps incorrectly) cached
SpigotTriton.asSpigot().getPlayerManager().unregisterPlayer(loginEvent.getUniqueId());
}
}

Expand All @@ -43,6 +45,8 @@ public void onLoginSync(PlayerLoginEvent loginEvent) {
.translateString(loginEvent.getKickMessage(), languagePlayer, Triton.get().getConfig().getKickSyntax())
.ifChanged(loginEvent::setKickMessage)
.ifUnchanged(() -> loginEvent.setKickMessage(""));
// Unregister the player, otherwise their language will stay (perhaps incorrectly) cached
SpigotTriton.asSpigot().getPlayerManager().unregisterPlayer(loginEvent.getPlayer().getUniqueId());
}
}

Expand Down

0 comments on commit 855629b

Please sign in to comment.