Ejemplo n.º 1
0
  @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);
    }
  }
Ejemplo n.º 2
0
  @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();
    }
  }
Ejemplo n.º 3
0
 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");
   }
 }
Ejemplo n.º 4
0
 public void onEntityDeath_playersAlive() {
   setAlivePlayerInTeam(arenaGame.getRedTeam());
   setAlivePlayerInTeam(arenaGame.getBlueTeam());
 }