Mineplex2018-withcommit/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/ClutchStatTracker.java

38 lines
857 B
Java
Raw Normal View History

package nautilus.game.arcade.stats;
import nautilus.game.arcade.game.Game;
import nautilus.game.arcade.game.games.common.CaptureTheFlag;
2015-10-10 05:15:19 +02:00
import nautilus.game.arcade.game.games.common.ctf_data.CarrierCombatDeathEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
public class ClutchStatTracker extends StatTracker<CaptureTheFlag>
{
private final String _stat;
public ClutchStatTracker(CaptureTheFlag game, String stat)
{
super(game);
_stat = stat;
}
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
2015-10-10 05:15:19 +02:00
public void onCombatDeath(CarrierCombatDeathEvent event)
{
if (getGame().GetState() != Game.GameState.Live)
return;
if (!getGame().isSuddenDeath())
return;
2015-10-10 05:15:19 +02:00
addStat(event.GetPlayer(true), getStat(), 1, false, false);
}
public String getStat()
{
return _stat;
}
}