Mineplex2018-withcommit/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/KaboomStatTracker.java
2014-10-27 18:09:23 -04:00

36 lines
948 B
Java

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.getHealth() != player.getMaxHealth())
return;
}
addStat(event.getThrower(), "Kaboom", 1, true, false);
}
}
}
}