package vg.civcraft.mc.civchat2.command;

import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;

import vg.civcraft.mc.civmodcore.command.Command;
import vg.civcraft.mc.civmodcore.command.CommandHandler;
import vg.civcraft.mc.civchat2.command.commands.Exit;
import vg.civcraft.mc.civchat2.command.commands.GroupChat;
import vg.civcraft.mc.civchat2.command.commands.Ignore;
import vg.civcraft.mc.civchat2.command.commands.IgnoreGroup;
import vg.civcraft.mc.civchat2.command.commands.IgnoreList;
import vg.civcraft.mc.civchat2.command.commands.Reply;
import vg.civcraft.mc.civchat2.command.commands.SayAll;
import vg.civcraft.mc.civchat2.command.commands.Tell;
import vg.civcraft.mc.civchat2.command.commands.Afk;

public class CivChat2CommandHandler extends CommandHandler{

	public void registerCommands(){
		addCommands(new Tell("tell"));
		addCommands(new Afk("afk"));
		addCommands(new Reply("reply"));
		addCommands(new GroupChat("groupc"));
		addCommands(new Ignore("ignore"));
		addCommands(new IgnoreGroup("ignoregroup"));
		addCommands(new IgnoreList("ignorelist"));
		addCommands(new Exit("exit"));
		addCommands(new SayAll("sayall"));
	}
	
	public void addCommands(Command command){
		commands.put(command.getIdentifier().toLowerCase(), command);
	}
	
	public void helpPlayer(Command command, CommandSender sender){
		StringBuilder sb = new StringBuilder();
		
		String cmd = sb.append(ChatColor.RED)
						.append("Command: ")
						.append(command.getName().toString())
						.toString();
		sb.delete(0, sb.length());
		
		String desc = sb.append(ChatColor.RED)
						.append("Description: ")
						.append(command.getDescription().toString())
						.toString();
		sb.delete(0, sb.length());
		
		String usage = sb.append(ChatColor.RED)
						.append("Usage: ")
						.append(command.getUsage().toString())
						.toString();
		sb.delete(0, sb.length());
		
		sender.sendMessage(cmd);
		sender.sendMessage(desc);
		sender.sendMessage(usage);
	}
}

@@ -1161,815 +1161,6 @@
 %0A%09%7D%0A
-%09%0A%09public void addCommands(Command command)%7B%0A%09%09commands.put(command.getIdentifier().toLowerCase(), command);%0A%09%7D%0A%09%0A%09public void helpPlayer(Command command, CommandSender sender)%7B%0A%09%09StringBuilder sb = new StringBuilder();%0A%09%09%0A%09%09String cmd = sb.append(ChatColor.RED)%0A%09%09%09%09%09%09.append(%22Command: %22)%0A%09%09%09%09%09%09.append(command.getName().toString())%0A%09%09%09%09%09%09.toString();%0A%09%09sb.delete(0, sb.length());%0A%09%09%0A%09%09String desc = sb.append(ChatColor.RED)%0A%09%09%09%09%09%09.append(%22Description: %22)%0A%09%09%09%09%09%09.append(command.getDescription().toString())%0A%09%09%09%09%09%09.toString();%0A%09%09sb.delete(0, sb.length());%0A%09%09%0A%09%09String usage = sb.append(ChatColor.RED)%0A%09%09%09%09%09%09.append(%22Usage: %22)%0A%09%09%09%09%09%09.append(command.getUsage().toString())%0A%09%09%09%09%09%09.toString();%0A%09%09sb.delete(0, sb.length());%0A%09%09%0A%09%09sender.sendMessage(cmd);%0A%09%09sender.sendMessage(desc);%0A%09%09sender.sendMessage(usage);%0A%09%7D%0A
 %7D%0A

Remove duplicated methods from CivModCore commandhandler