7f4bcd1210
new scoreboard (not implemented yet) reward changes
40 lines
1015 B
Java
40 lines
1015 B
Java
package nautilus.game.arcade.stats;
|
|
|
|
import org.bukkit.entity.Player;
|
|
import org.bukkit.event.EventHandler;
|
|
import org.bukkit.event.EventPriority;
|
|
|
|
import mineplex.core.common.util.UtilPlayer;
|
|
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
|
|
import nautilus.game.arcade.game.Game;
|
|
|
|
public class DeathsStatTracker extends StatTracker<Game>
|
|
{
|
|
public DeathsStatTracker(Game game)
|
|
{
|
|
super(game);
|
|
}
|
|
|
|
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
|
public void onCombatDeath(CombatDeathEvent event)
|
|
{
|
|
if (getGame().GetState() != Game.GameState.Live)
|
|
return;
|
|
|
|
if (event.GetLog().GetPlayer() == null)
|
|
return;
|
|
|
|
if (!event.GetLog().GetPlayer().IsPlayer())
|
|
return;
|
|
|
|
Player player = UtilPlayer.searchExact(event.GetLog().GetPlayer().GetName());
|
|
if (player == null)
|
|
return;
|
|
|
|
addStat(player, "Deaths", 1, false, false);
|
|
|
|
// if (getGame().GetKit(player) != null)
|
|
// addStat(player, getGame().GetKit(player).GetName() + " Deaths", 1, false, false);
|
|
}
|
|
}
|