Skip to content

Commit

Permalink
fix(spigot): players not being unregistered if kicked during login (#375
Browse files Browse the repository at this point in the history
)
  • Loading branch information
diogotcorreia authored Jan 14, 2024
1 parent 09d2690 commit 12bf753
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 12bf753

Please sign in to comment.