35 lines
777 B
Java
35 lines
777 B
Java
|
package nautilus.game.arcade.stats;
|
||
|
|
||
|
import nautilus.game.arcade.events.*;
|
||
|
import nautilus.game.arcade.game.*;
|
||
|
import org.bukkit.entity.*;
|
||
|
import org.bukkit.event.*;
|
||
|
|
||
|
import java.util.*;
|
||
|
|
||
|
public class WinStatTracker extends StatTracker<Game>
|
||
|
{
|
||
|
public WinStatTracker(Game game)
|
||
|
{
|
||
|
super(game);
|
||
|
}
|
||
|
|
||
|
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||
|
public void onGameStateChange(GameStateChangeEvent event)
|
||
|
{
|
||
|
if (event.GetState() == Game.GameState.End)
|
||
|
{
|
||
|
List<Player> winners = getGame().getWinners();
|
||
|
|
||
|
if (winners != null)
|
||
|
{
|
||
|
for (Player winner : winners)
|
||
|
{
|
||
|
getGame().AddStat(winner, "Wins", 1, false, false);
|
||
|
getGame().AddStat(winner, getGame().GetKit(winner).GetName() + " Wins", 1, false, false);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|