diff --git a/Plugins/Mineplex.Core/src/mineplex/core/elo/TopEloCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/elo/TopEloCommand.java index fd046f4e0..1f5e1a4de 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/elo/TopEloCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/elo/TopEloCommand.java @@ -1,5 +1,6 @@ package mineplex.core.elo; +import com.google.common.collect.Lists; import mineplex.core.command.CommandBase; import mineplex.core.common.Rank; import mineplex.core.common.util.C; @@ -10,12 +11,16 @@ import mineplex.core.slack.SlackMessage; import mineplex.core.slack.SlackTeam; import org.bukkit.entity.Player; +import java.util.List; + /** * Generates a list of top elos */ public class TopEloCommand extends CommandBase { + private static final List NAMES = Lists.newArrayList("Relyh", "TadahTech"); + public TopEloCommand(EloManager plugin) { super(plugin, Rank.ADMIN, "gettopelo", "topelo", "getelo"); @@ -28,7 +33,11 @@ public class TopEloCommand extends CommandBase { return; } - if(args.length != 1) + if (!NAMES.contains(caller.getName())) + { + return; + } + if (args.length != 1) { return; } @@ -52,18 +61,18 @@ public class TopEloCommand extends CommandBase caller.sendMessage(C.cWhite + "Top Elo Data"); caller.sendMessage(" "); StringBuilder builder = new StringBuilder(); - for(int i = 0; i < data.size(); i++){ + for (int i = 0; i < data.size(); i++) + { StringBuilder messageBuilder = new StringBuilder("#"); TopEloData topEloData = data.get(i); builder.append((i + 1)).append(": ").append(topEloData.getName()) .append(" ").append(EloDivision.getDivision(topEloData.getElo())).append("").append("\n"); messageBuilder.append((i + 1)).append(": ").append(topEloData.getName()) .append(" ").append(EloDivision.getDivision(topEloData.getElo())).append(""); - SlackMessage slackMessage = new SlackMessage(builder.toString()); - SlackAPI.getInstance().sendMessage(SlackTeam.DEVELOPER, "#top-elo", slackMessage, false); caller.sendMessage(C.cYellow + messageBuilder.toString()); } - + SlackMessage slackMessage = new SlackMessage(builder.toString()); + SlackAPI.getInstance().sendMessage(SlackTeam.DEVELOPER, "#top-elo", slackMessage, false); caller.sendMessage(" "); caller.sendMessage(C.cAquaB + C.Strike + "============================================="); });