package me.otisdiver.otisarena;

import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;

import me.otisdiver.otisarena.task.EndGame;

public class Commander implements CommandExecutor {

    private OtisArena main;
    
    /** Handles plugin commands.
     * 
     * @param main instance of JavaPlugin
     */
    public Commander(OtisArena main) {
        this.main = main;
    }
    
    @Override
    public boolean onCommand(CommandSender sender, Command command, String cmd, String[] args) {
        if (cmd.equalsIgnoreCase("endgame")) {
            if (!sender.hasPermission("gameadmin")) return false;
            if (args.length != 1) return false;
            
            String arg = args[0].toLowerCase();
            if (arg.equals("no")) {
                new EndGame(main, false);
                Bukkit.getServer().shutdown();
            }
            else if (args.equals("yes")) {
                new EndGame(main, true);
            }
            
            else return false;
            return true;
        }
        return false;
    }

}

@@ -52,16 +52,45 @@
 Bukkit;%0A
+import org.bukkit.ChatColor;%0A
 import o
@@ -116,16 +116,16 @@
 ommand;%0A
-
 import o
@@ -299,16 +299,110 @@
 utor %7B%0A%0A
+    private static final String noAccessMessage = ChatColor.DARK_RED + %22Access denied!%22;%0A    %0A
     priv
@@ -803,29 +803,113 @@
 dmin%22)) 
-return false;
+%7B%0A                sender.sendMessage(noAccessMessage);%0A                return true;%0A            %7D
 %0A       

fix no permission message