30 lines
768 B
Java
30 lines
768 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.*;
|
||
|
|
||
|
public class WinWithoutLosingTeammateStatTracker extends StatTracker<TeamGame>
|
||
|
{
|
||
|
public WinWithoutLosingTeammateStatTracker(TeamGame game)
|
||
|
{
|
||
|
super(game);
|
||
|
}
|
||
|
|
||
|
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||
|
public void onGameStateChange(GameStateChangeEvent event)
|
||
|
{
|
||
|
if (event.GetState() == Game.GameState.End)
|
||
|
{
|
||
|
GameTeam winner = getGame().WinnerTeam;
|
||
|
|
||
|
if (winner.GetPlayers(true).size() == winner.GetPlayers(false).size())
|
||
|
{
|
||
|
for (Player player : winner.GetPlayers(true))
|
||
|
getGame().AddStat(player, "FlawlessVictory", 1, true, false);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|