Hub + Stats + Tournament

This commit is contained in:
Chiss 2013-12-14 16:51:08 +11:00
parent 3ca67d60c0
commit c582b210b5
3 changed files with 15 additions and 9 deletions

View File

@ -278,10 +278,16 @@ public class StatsManager extends MiniPlugin
public int getStat(String player, String table, String stat) public int getStat(String player, String table, String stat)
{ {
if (!_playerStatList.containsKey(table)) if (!_playerStatList.containsKey(table))
{
System.out.println("STATS ERROR: Table doesn't exist (" + table + ")");
return 0; return 0;
}
if (!_playerStatList.get(table).containsKey(player)) if (!_playerStatList.get(table).containsKey(player))
{
System.out.println("STATS ERROR: Player doesn't exist (" + player + ")");
return 0; return 0;
}
PlayerStats stats = _playerStatList.get(table).get(player); PlayerStats stats = _playerStatList.get(table).get(player);

View File

@ -117,6 +117,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
_visibilityManager = new VisibilityManager(this); _visibilityManager = new VisibilityManager(this);
_statsManager = new StatsManager(plugin); _statsManager = new StatsManager(plugin);
_statsManager.addTable("Pvp");
} }
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
@ -282,11 +283,11 @@ public class HubManager extends MiniClientPlugin<HubClient>
Objective obj = board.getObjective(DisplaySlot.BELOW_NAME); Objective obj = board.getObjective(DisplaySlot.BELOW_NAME);
if (obj == null) if (obj == null)
{ {
obj = board.registerNewObjective("Tournament Kills", "dummy"); obj = board.registerNewObjective("SG Tourney Kills", "dummy");
obj.setDisplaySlot(DisplaySlot.BELOW_NAME); obj.setDisplaySlot(DisplaySlot.BELOW_NAME);
} }
obj.getScore(event.getPlayer()).setScore(GetStats().GetStat(event.getPlayer(), "Pvp", "Kills")); obj.getScore(event.getPlayer()).setScore(GetStats().getStat(event.getPlayer(), "Pvp", "Kills"));
} }
if (event.getPlayer().getScoreboard() != null) if (event.getPlayer().getScoreboard() != null)
@ -296,7 +297,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
Objective obj = board.getObjective(DisplaySlot.BELOW_NAME); Objective obj = board.getObjective(DisplaySlot.BELOW_NAME);
if (obj == null) if (obj == null)
{ {
obj = board.registerNewObjective("Tournament Kills", "dummy"); obj = board.registerNewObjective("SG Tournament Kills", "dummy");
obj.setDisplaySlot(DisplaySlot.BELOW_NAME); obj.setDisplaySlot(DisplaySlot.BELOW_NAME);
} }
@ -305,7 +306,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
if (player.equals(event.getPlayer())) if (player.equals(event.getPlayer()))
continue; continue;
obj.getScore(player).setScore(player.getName().length()); obj.getScore(player).setScore(GetStats().getStat(player, "Pvp", "Kills"));
} }
} }
} }

View File

@ -31,10 +31,9 @@ public class NewsManager extends MiniPlugin
_news = new String[] _news = new String[]
{ {
"New Game: " + C.cGold + C.Bold + "Block Hunt" + ChatColor.RESET + "!", C.cYellow + C.Bold + "SG Tournament: " + C.cAqua + C.Bold + "Most Kills Over Weekend" + ChatColor.RESET + "!",
"Prices lowered by " + C.cGreen + C.Bold + "50%" + ChatColor.RESET + " on everything!", C.cYellow + C.Bold + "Tournament Prize: " + C.cAqua + C.Bold + "Minecon 2013 Cape" + ChatColor.RESET + "!",
"New Game: " + C.cGold + C.Bold + "Survival Games" + ChatColor.RESET + "!", "Europe Servers: " + C.cGreen + C.Bold + "Will be back ASAP" + ChatColor.RESET + "!",
"Europe Servers: " + C.cGreen + C.Bold + "eu.mineplex.com" + ChatColor.RESET + "!",
"New Game: " + C.cGold + C.Bold + "Draw My Thing" + ChatColor.RESET + "!", "New Game: " + C.cGold + C.Bold + "Draw My Thing" + ChatColor.RESET + "!",
}; };
} }