package in.twizmwaz.cardinal.command;

import com.sk89q.minecraft.util.commands.Command;
import com.sk89q.minecraft.util.commands.CommandContext;
import com.sk89q.minecraft.util.commands.CommandException;
import in.twizmwaz.cardinal.GameHandler;
import in.twizmwaz.cardinal.match.Match;
import in.twizmwaz.cardinal.match.MatchState;
import in.twizmwaz.cardinal.module.modules.matchTimer.MatchTimer;
import in.twizmwaz.cardinal.module.modules.startTimer.StartTimer;
import in.twizmwaz.cardinal.module.modules.team.TeamModule;
import in.twizmwaz.cardinal.util.ChatUtils;
import in.twizmwaz.cardinal.util.TeamUtils;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class ReadyCommand {

    @Command(aliases = {"ready"}, desc = "Make your team ready.")
    public static void ready(final CommandContext cmd, CommandSender sender) throws CommandException {
        TeamModule team = TeamUtils.getTeamByPlayer((Player) sender);
        if (!team.isReady()) {
            team.setReady(true);
            ChatUtils.getGlobalChannel().sendMessage(team.getCompleteName() + ChatColor.YELLOW + " is now ready");
            if (TeamUtils.teamsReady()) GameHandler.getGameHandler().getMatch().start(600);
        } else throw new CommandException("Your team is already ready!");
    }

    @Command(aliases = {"unready"}, desc = "Make your team not ready.")
    public static void unready(final CommandContext cmd, CommandSender sender) throws CommandException {
        TeamModule team = TeamUtils.getTeamByPlayer((Player) sender);
        if (team.isReady()) {
            team.setReady(false);
            ChatUtils.getGlobalChannel().sendMessage(team.getCompleteName() + ChatColor.YELLOW + " is no longer ready");
            if (GameHandler.getGameHandler().getMatch().getState().equals(MatchState.STARTING)) {
                GameHandler.getGameHandler().getMatch().setState(MatchState.WAITING);
                GameHandler.getGameHandler().getMatch().getModules().getModule(StartTimer.class).setCancelled(true);
                ChatUtils.getGlobalChannel().sendMessage(ChatColor.RED + "Match start countdown cancelled because " + team.getCompleteName() + ChatColor.RED + " became un-ready.");
            }
        } else throw new CommandException("Your team is already not ready!");
    }

}

@@ -926,32 +926,137 @@
 mandException %7B%0A
+        if (!(sender instanceof Player)) throw new CommandException(%22Console cannot use this command!%22);%0A
         TeamModu
@@ -1630,32 +1630,137 @@
 mandException %7B%0A
+        if (!(sender instanceof Player)) throw new CommandException(%22Console cannot use this command!%22);%0A
         TeamModu

Disable console from using ready commands, fixes #363