scoreboard playing players
This commit is contained in:
parent
cab2ec9fa3
commit
ceafe6ebfb
@ -30,6 +30,17 @@ public class GameManager {
|
|||||||
private final Map<UUID, Set<GameRequest>> gameRequests = new TtlHashMap<>(TimeUnit.SECONDS, 30);
|
private final Map<UUID, Set<GameRequest>> gameRequests = new TtlHashMap<>(TimeUnit.SECONDS, 30);
|
||||||
@Getter private final Map<UUID, Game> games = new ConcurrentHashMap<>();
|
@Getter private final Map<UUID, Game> games = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
public int getFighters() {
|
||||||
|
int i = 0;
|
||||||
|
for (Game game : this.games.values()) {
|
||||||
|
for (GameTeam team : game.getTeams()) {
|
||||||
|
i += team.getPlayingPlayers().size();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
public Game getGame(PlayerData playerData) {
|
public Game getGame(PlayerData playerData) {
|
||||||
return this.games.get(playerData.getCurrentGameId());
|
return this.games.get(playerData.getCurrentGameId());
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ public class ScoreboardProvider implements AssembleAdapter {
|
|||||||
lines.add(CC.scoreboardBar);
|
lines.add(CC.scoreboardBar);
|
||||||
}
|
}
|
||||||
lines.add("&fOnline: &d" + this.main.getServer().getOnlinePlayers().size());
|
lines.add("&fOnline: &d" + this.main.getServer().getOnlinePlayers().size());
|
||||||
lines.add("&fPlaying: &d");
|
lines.add("&fPlaying: &d" + this.main.getGameManager().getFighters());
|
||||||
lines.add(" ");
|
lines.add(" ");
|
||||||
|
|
||||||
if (true) {
|
if (true) {
|
||||||
|
Loading…
Reference in New Issue
Block a user