Update from Git Manager GUI

This commit is contained in:
2026-03-17 16:15:01 +01:00
parent 22c5837455
commit a6d17f4d64
6 changed files with 483 additions and 40 deletions

View File

@@ -124,6 +124,34 @@ public class StatsManager {
save();
}
public boolean resetStats(UUID uuid) {
boolean removed = cache.remove(uuid) != null;
if (!removed) {
return false;
}
save();
return true;
}
public int resetAllStats() {
int count = cache.size();
if (count == 0) {
return 0;
}
cache.clear();
save();
return count;
}
public UUID findPlayerUuidByName(String playerName) {
for (Map.Entry<UUID, PlayerStats> entry : cache.entrySet()) {
if (entry.getValue().name != null && entry.getValue().name.equalsIgnoreCase(playerName)) {
return entry.getKey();
}
}
return null;
}
/** Gibt die Top-N-Torschützen zurück, sortiert nach Toren */
public List<Map.Entry<UUID, PlayerStats>> getTopScorers(int limit) {
List<Map.Entry<UUID, PlayerStats>> list = new ArrayList<>(cache.entrySet());