gt:         for (Player player : players.keySet()) {
context: /*
   *            This file is part of Libelula Minecraft Edition Project.
   *
   *  Libelula Minecraft Edition is free software: you can redistribute it and/or 
   *  modify it under the terms of the GNU General Public License as published by
   *  the Free Software Foundation, either version 3 of the License, or
   *  (at your option) any later version.
   *
   *  Libelula Minecraft Edition is distributed in the hope that it will be useful,
   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   *  GNU General Public License for more details.
   *
   *  You should have received a copy of the GNU General Public License
   *  along with Libelula Minecraft Edition. 
   *  If not, see <http://www.gnu.org/licenses/>.
   * 
   */
  package me.libelula.climber;
  
  import java.util.ArrayList;
  import java.util.Comparator;
  import java.util.List;
  import java.util.Map;
  import java.util.SortedSet;
  import java.util.TreeMap;
  import java.util.TreeSet;
  import org.bukkit.ChatColor;
  import org.bukkit.Location;
  import org.bukkit.Material;
  import org.bukkit.Sound;
  import org.bukkit.block.Block;
  import org.bukkit.entity.Player;
  import org.bukkit.inventory.ItemStack;
  import org.bukkit.potion.PotionEffect;
  
  /**
   *
   * @author Diego D'Onofrio <ddonofrio@member.fsf.org>
   */
  public class Game {
  
      private final Main plugin;
      private final TreeMap<String, List<Location>> freeTeamPos;
      private final MapManager.Arena arena;
      private final TreeMap<Player, PlayerInfo> players;
      private gameState state;
      private boolean pairTick;
      //private int countDown;
      private final Round round;
      private final TreeMap<Location, Material> blockingMaterials;
      private final TreeMap<Location, Material> towerMaterials;
      
      public gameState getGameState() {
          return state;
      }
  
      public int getPlayerCount() {
          return players.size();
      }
      
      public String getTeam(Player player) {
          PlayerInfo pi = players.get(player);
          if (pi != null) {
              return pi.team;
          } else {
              return null;
          }
      }
  
      public MapManager.Arena getArena() {
          return arena;
      }
  
      public Main getPlugin() {
          return plugin;
      }
  
      private class PlayerInfo {
  
          String team;
          Location spawnPoint;
      }
  
      public enum gameState {
  
          WAITING_FOR_PLAYERS, IN_GAME
      }
  
      public Game(Main plugin, String mapName) {
          this.plugin = plugin;
          this.arena = plugin.mapMan.getArena(mapName);
          freeTeamPos = new TreeMap<>();
          for (String team : plugin.mapMan.getArena(mapName).teamSpawnPoints.keySet()) {
              List<Location> locs = new ArrayList<>();
              locs.addAll(plugin.mapMan.getArena(mapName).teamSpawnPoints.get(team));
              freeTeamPos.put(team, locs);
          }
          players = new TreeMap<>(new Main.PlayerComparator());
          state = gameState.WAITING_FOR_PLAYERS;
          round = new Round(this);
          round.setRound(-1);
          blockingMaterials = new TreeMap<>(new Main.LocationComparator());
          towerMaterials = new TreeMap<>(new Main.LocationComparator());
          for (Block block : arena.blockingBlocks) {
              blockingMaterials.put(block.getLocation(), block.getType());
          }
          /*
           for (int i = 1; i < 11; i++) {
           Location loc = new Location(arena.capturePoint.getWorld(), arena.capturePoint.getBlockX(), arena.capturePoint.getBlockY(), arena.capturePoint.getBlockZ());
           loc.setY(loc.getY() - i);
           towerMaterials.put(loc, loc.getBlock().getType());
           }
           */
      }
  
      /*
       public void restoreBlocks() {
       for (int i = 1; i < 11; i++) {
       Location loc = new Location(arena.capturePoint.getWorld(), arena.capturePoint.getBlockX(), arena.capturePoint.getBlockY(), arena.capturePoint.getBlockZ());
       loc.setY(loc.getY() - i);
       loc.getBlock().setType(towerMaterials.get(loc));
       }
       closeCages();
       }
       */
      
      public boolean isInGame(Player player) {
          return players.containsKey(player);
      }
      
      public boolean addPlayer(Player player, String team) {
          if (state != gameState.WAITING_FOR_PLAYERS) {
              player.sendMessage(ChatColor.RED + "No puedes entrar ahora en este juego.");
              return false;
          }
          List<Location> freeLocations = freeTeamPos.get(team);
          if (freeLocations.isEmpty()) {
              player.sendMessage(ChatColor.RED + "No hay posisiones libres en este equipo");
              return false;
          }
  
          PlayerInfo pi = new PlayerInfo();
          pi.team = team;
          pi.spawnPoint = freeLocations.remove(0);
          players.put(player, pi);
  
          plugin.teamMan.disguise(player, team);
          moveToSpawn(player);
  
          if (players.size() >= arena.maxPlayers) {
              startGame();
          } else if (players.size() >= arena.minPlayers) {
              //startCountDown();
          }
          
          plugin.gameControler.updateSigngs(this);
          return true;
      }
  
      public boolean addPlayer(Player player) {
          if (state != gameState.WAITING_FOR_PLAYERS) {
              player.sendMessage(ChatColor.RED + "No puedes entrar ahora en este juego.");
              return false;
          }
          int min = arena.maxPlayers;
          String minTeamName = null;
          for (String teamName : freeTeamPos.keySet()) {
              if (!freeTeamPos.get(teamName).isEmpty()) {
                  if (min > freeTeamPos.get(teamName).size()) {
                      min = freeTeamPos.get(teamName).size();
                      minTeamName = teamName;
                  }
              }
          }
  
          if (minTeamName != null) {
              addPlayer(player, minTeamName);
              return true;
          }
          return false;
      }
  
      public void removePlayer(Player player) {
          PlayerInfo pi = players.remove(player);
          plugin.teamMan.getScore(player).setScore(0);
          freeTeamPos.get(pi.team).add(pi.spawnPoint);
          plugin.teamMan.backToNormal(player);
          player.teleport(plugin.mapMan.getLobby());
          if (players.isEmpty()) {
              endGame();
          }
          plugin.gameControler.updateSigngs(this);
      }
  
      public void removeAllPlayers() {
          List<Player> playerList = new ArrayList();
          playerList.addAll(players.keySet());
          for (Player player : playerList) {
              removePlayer(player);
          }
      }
  
      /*
      public void startCountDown() {
          countDown = arena.waitSecForPlayers + 1;
      }
      */
      public void messageAll(String message) {
  