Update from Git Manager GUI
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user