Search in sources :

Example 1 with Game

use of net.warvale.core.game.Game in project GameCore by Warvale.

the class GameStart method startCountdown.

public static void startCountdown() {
    //runs when there is at least one player on each team (change in TeamSelect lines 113 and 133)
    map = null;
    mapNumbers.put(1, "Redwood Forest");
    mapNumbers.put(2, "Volcano Island");
    mapNumbers.put(3, "Pagoda Everglade");
    mapNumbers.put(4, "Extraterrestrial");
    votes.put("redwood_forest", 0);
    votes.put("volcano_island", 0);
    votes.put("pagoda_everglade", 0);
    votes.put("extraterrestrial", 0);
    new Game().setState(State.COUNTDOWN);
    initActive = true;
    for (Player player : Bukkit.getServer().getOnlinePlayers()) {
        if (player.isOp()) {
            player.sendMessage(ChatColor.DARK_RED + "[STAFF]" + ChatColor.WHITE + " The game is starting!");
        }
    }
    votingActive = true;
    voted.clear();
    //Get team players
    for (String player : Main.getTeams().getBlueTeam().getEntries()) {
        teamBlue.add(Bukkit.getPlayer(player));
    }
    for (String player : Main.getTeams().getRedTeam().getEntries()) {
        teamRed.add(Bukkit.getPlayer(player));
    }
    //send voting message
    for (int i = 0; i < teamBlue.size(); i++) {
        Player p = teamBlue.get(i);
        p.sendMessage(ChatColor.RED.toString() + ChatColor.BOLD + "/vote #" + ChatColor.BLUE.toString() + ChatColor.BOLD + " to vote for a map!" + ChatColor.DARK_BLUE + "\n1: Redwood Forest" + "\n2: Volcano Island" + "\n3: Pagoda Everglade" + "\n4: Extraterrestrial");
    }
    for (int i = 0; i < teamRed.size(); i++) {
        Player p = teamRed.get(i);
        p.sendMessage(ChatColor.RED.toString() + ChatColor.BOLD + "/vote #" + ChatColor.BLUE.toString() + ChatColor.BOLD + " to vote for a map!" + ChatColor.DARK_BLUE + "\n1: Redwood Forest" + "\n2: Volcano Island" + "\n3: Pagoda Everglade" + "\n4: Extraterrestrial");
    }
    new StartTask(map).run();
}
Also used : StartTask(net.warvale.core.tasks.StartTask) Player(org.bukkit.entity.Player) Game(net.warvale.core.game.Game)

Aggregations

Game (net.warvale.core.game.Game)1 StartTask (net.warvale.core.tasks.StartTask)1 Player (org.bukkit.entity.Player)1