Mineplex2018-withcommit/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/DeathsStatTracker.java
2014-08-18 16:41:16 -04:00

33 lines
843 B
Java

package nautilus.game.arcade.stats;
import mineplex.core.common.util.*;
import mineplex.minecraft.game.core.combat.event.*;
import nautilus.game.arcade.game.*;
import org.bukkit.entity.*;
import org.bukkit.event.*;
public class DeathsStatTracker extends StatTracker<Game>
{
public DeathsStatTracker(Game game)
{
super(game);
}
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onCombatDeath(CombatDeathEvent event)
{
if (event.GetLog().GetPlayer() == null)
return;
if (!event.GetLog().GetPlayer().IsPlayer())
return;
Player player = UtilPlayer.searchExact(event.GetLog().GetPlayer().GetName());
if (player == null)
return;
getGame().AddStat(player, "Deaths", 1, false, false);
getGame().AddStat(player, getGame().GetKit(player).GetName() + " Deaths", 1, false, false);
}
}