This commit is contained in:
Luca
2021-11-23 16:58:23 +01:00
parent e1fba0573c
commit 4ce0e46b0d
4 changed files with 78 additions and 1 deletions

View File

@ -26,6 +26,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
public class ScoreboardProvider implements BoardAdapter {
@ -243,8 +244,32 @@ public class ScoreboardProvider implements BoardAdapter {
private List<String> spectatingScoreboard(PlayerData playerData) {
List<String> lines = new ArrayList<>();
Game game = this.plugin.getGameManager().getSpectatingGame(playerData.getUniqueId());
GameTeam yourTeam = game.getTeams().get(0);
GameTeam opposingTeam = game.getTeams().get(1);
lines.add(CC.scoreboardBar);
lines.add("&fDuration: &d" + game.getDuration());
lines.add(" ");
if (yourTeam.isHasBed()) {
lines.add("&7[" + yourTeam.getPlayerTeam().getChatColor() + yourTeam.getPlayerTeam().getSmallName() + "&7] &a&l✓ &7(You)");
} else if (yourTeam.getPlayingPlayers().size() > 0) {
lines.add("&7[" + yourTeam.getPlayerTeam().getChatColor() + yourTeam.getPlayerTeam().getSmallName() + "&7] &f" + yourTeam.getPlayingPlayers().size() + " &7(You)");
} else {
lines.add("&7[" + yourTeam.getPlayerTeam().getChatColor() + yourTeam.getPlayerTeam().getSmallName() + "&7] &c&l✗ &7(You)");
}
if (opposingTeam.isHasBed()) {
lines.add("&7[" + opposingTeam.getPlayerTeam().getChatColor() + opposingTeam.getPlayerTeam().getSmallName() + "&7] &a&l✓");
} else if (opposingTeam.getPlayingPlayers().size() > 0) {
lines.add("&7[" + opposingTeam.getPlayerTeam().getChatColor() + opposingTeam.getPlayerTeam().getSmallName() + "&7] &f" + yourTeam.getPlayingPlayers().size());
} else {
lines.add("&7[" + opposingTeam.getPlayerTeam().getChatColor() + opposingTeam.getPlayerTeam().getSmallName() + "&7] &c&l✗");
}
lines.add(" ");
lines.add(yourTeam.getPlayerTeam().getChatColor() + yourTeam.playingPlayers().collect(Collectors.toList()).get(0).getName());
lines.add("&7VS");
lines.add(opposingTeam.getPlayerTeam().getChatColor() + opposingTeam.playingPlayers().collect(Collectors.toList()).get(0).getName());
lines.add("&dtilly.rip");
lines.add(CC.scoreboardBar);
return CC.translate(lines);