示例#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);
    }
  }
示例#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();
    }
  }
示例#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");
   }
 }
示例#4
0
 public void onEntityDeath_playersAlive() {
   setAlivePlayerInTeam(arenaGame.getRedTeam());
   setAlivePlayerInTeam(arenaGame.getBlueTeam());
 }