public AllKills(Match match) { super(match); kills = new ArenaObjective("allkills", "All Kills", 5); kills.setDisplayName(MessageUtil.colorChat("&4All Kills")); boolean isRated = match.getParams().isRated(); boolean soloRating = !match.getParams().isTeamRating(); sc = (isRated && soloRating) ? new StatController(match.getParams()) : null; }
@ArenaEventHandler(priority = EventPriority.LOW) public void onFindCurrentLeader(MatchFindCurrentLeaderEvent event) { Collection<ArenaTeam> leaders = kills.getLeaders(); if (leaders.size() > 1) { event.setCurrentDrawers(leaders); } else { event.setCurrentLeaders(leaders); } }
@Override public void setDisplayTeams(boolean display) { kills.setDisplayTeams(display); }
@Override public TreeMap<Integer, Collection<ArenaTeam>> getRanks() { return kills.getTeamRanks(); }
@Override public List<ArenaTeam> getLeaders() { return kills.getTeamLeaders(); }
@ArenaEventHandler(priority = EventPriority.LOW) public void playerKillEvent(ArenaPlayerKillEvent event) { kills.addPoints(event.getPlayer(), event.getPoints()); kills.addPoints(event.getTeam(), event.getPoints()); if (sc != null) sc.addRecord(event.getPlayer(), event.getTarget(), WinLossDraw.WIN); }