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

36 lines
921 B
Java
Raw Normal View History

2014-10-11 03:49:03 +02:00
package nautilus.game.arcade.stats;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import nautilus.game.arcade.game.games.minestrike.MineStrike;
import nautilus.game.arcade.game.games.minestrike.items.grenades.Grenade;
import nautilus.game.arcade.game.games.minestrike.items.grenades.HighExplosive;
public class KaboomStatTracker extends StatTracker<MineStrike>
{
public KaboomStatTracker(MineStrike game)
{
super(game);
}
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onGrenadeExplode(Grenade.GrenadeExplodeEvent event)
{
if (event.getGrenade() instanceof HighExplosive)
{
if (event.getDamagedPlayers().size() >= 2)
{
for (Player player : event.getDamagedPlayers())
{
if (!player.isDead())
return;
}
addStat(event.getThrower(), "Kaboom", 1, true, false);
}
}
}
}