From 9ad241d5fc174561175fc7b0a30a52c805158589 Mon Sep 17 00:00:00 2001 From: TBG <46306028+TBG1000@users.noreply.github.com> Date: Sat, 23 Jul 2022 14:03:56 -0500 Subject: [PATCH] Start embed color to white, finish embed color to winner color --- src/main/java/me/tbg/match/bot/MatchFinishListener.java | 7 +++++-- src/main/java/me/tbg/match/bot/MatchStartListener.java | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/me/tbg/match/bot/MatchFinishListener.java b/src/main/java/me/tbg/match/bot/MatchFinishListener.java index 8ea88cf..c216142 100644 --- a/src/main/java/me/tbg/match/bot/MatchFinishListener.java +++ b/src/main/java/me/tbg/match/bot/MatchFinishListener.java @@ -31,18 +31,21 @@ public void onMatchFinish(MatchFinishEvent event) { Collection teams = match.getCompetitors(); String winner = ""; - for (Competitor competitor : match.getCompetitors()) { + Color winnerColor = null; + for (Competitor competitor : teams) { if (event.getWinners().contains(competitor)) { if (event.getWinners().size() == 1) { winner = competitor.getNameLegacy(); + winnerColor = new Color(competitor.getFullColor().asRGB()); } else { winner = "Tie"; + winnerColor = Color.RED; } } } EmbedBuilder matchInfo = new EmbedBuilder() - .setColor(Color.RED) + .setColor(winnerColor) .setTitle("Match #" + match.getId() + " has finished!") .setThumbnail(bot.getMapImageUrl(map)) .setDescription( diff --git a/src/main/java/me/tbg/match/bot/MatchStartListener.java b/src/main/java/me/tbg/match/bot/MatchStartListener.java index af60b0e..8aa9ca5 100644 --- a/src/main/java/me/tbg/match/bot/MatchStartListener.java +++ b/src/main/java/me/tbg/match/bot/MatchStartListener.java @@ -23,7 +23,7 @@ public void onMatchStart(MatchStartEvent event) { MapInfo map = match.getMap(); EmbedBuilder matchStartEmbed = new EmbedBuilder() - .setColor(Color.GREEN) + .setColor(Color.WHITE) .setTitle("Match #" + match.getId() + " has started!") .setThumbnail(bot.getMapImageUrl(map)) .setDescription(