@Override public void init() { for (Iterator<ArenaPlayer> iterator = arenaGame.getRedTeam().iterator(); iterator.hasNext(); ) { ArenaPlayer arenaPlayer = iterator.next(); giveMaxHealtAndPlayerInventory(arenaPlayer); } for (Iterator<ArenaPlayer> iterator = arenaGame.getBlueTeam().iterator(); iterator.hasNext(); ) { ArenaPlayer arenaPlayer = iterator.next(); giveMaxHealtAndPlayerInventory(arenaPlayer); } }
@Override public void destroyed() { for (Iterator<ArenaPlayer> iterator = arenaGame.getRedTeam().iterator(); iterator.hasNext(); ) { ArenaPlayer arenaPlayer = iterator.next(); arenaPlayer.getPlayer().getInventory().clear(); } for (Iterator<ArenaPlayer> iterator = arenaGame.getBlueTeam().iterator(); iterator.hasNext(); ) { ArenaPlayer arenaPlayer = iterator.next(); arenaPlayer.getPlayer().getInventory().clear(); } }
public void onPlayerQuit_removePlayerOffTeam(ArenaPlayer arenaPlayer, PlayerQuitEvent event) { Server server = arenaPlayer.getPlayer().getServer(); if (arenaGame.isOnRedTeam(arenaPlayer)) { arenaGame.getRedTeam().remove(arenaPlayer); server.broadcastMessage( ChatColor.RED + "Player " + arenaPlayer.getPlayer().getName() + " has been removed from RED team"); } else { arenaGame.getBlueTeam().remove(arenaPlayer); server.broadcastMessage( ChatColor.BLUE + "Player " + arenaPlayer.getPlayer().getName() + " has been removed from BLUE team"); } }
public void onEntityDeath_playersAlive() { setAlivePlayerInTeam(arenaGame.getRedTeam()); setAlivePlayerInTeam(arenaGame.getBlueTeam()); }