Add persistent player statistics tracking

Introduced the `PlayerStat` system to persist player statistics across sessions. Enhanced player management by linking `PlayerStat` with teams and saving/updating stats periodically. Refactored related methods to support the new functionality and ensure data integrity.
This commit is contained in:
2025-02-26 22:00:46 +01:00
parent e62d0df9df
commit c738f02d17
7 changed files with 89 additions and 20 deletions
@@ -30,10 +30,10 @@ public class TeamPlayer {
private GameClass gameClass;
private boolean isDead = false;
protected TeamPlayer(Player player, Team team) {
protected TeamPlayer(Player player, Team team, PlayerStat playerStat) {
this.uuid = player.getUniqueId();
this.team = team;
this.playerStat = new PlayerStat(uuid, player.getName());
this.playerStat = playerStat;
}
public void respawn(@NotNull Player player, @NotNull WorldBorderApi worldBorderApi, @NotNull GamePhase gamePhase) {