// Path: src/main/java/com/thundergemios10/survivalgames/util/MessageUtil.java
// public class MessageUtil {
// 
// 	private static HashMap<String, String>varcache = new HashMap<String, String>();
// 
// 
// 	public static String replaceColors(String s){
// 		if(s == null){
// 			return null;
// 		}
// 		return s.replaceAll("(&([a-fk-or0-9]))", "\u00A7$2");
// 	}
// 
// 	public static String replaceVars(String msg, HashMap<String, String>vars){
// 		boolean error = false;
// 		for(String s:vars.keySet()){
// 			try{
// 				msg.replace("{$"+s+"}", vars.get(s));
// 			}catch(Exception e){
// 				SurvivalGames.$(Level.WARNING, "Failed to replace string vars. Error on "+s);
// 				error = true;
// 			}
// 		}
// 		if(error){
// 			SurvivalGames.$(Level.SEVERE, "Error replacing vars in message: "+msg);
// 			SurvivalGames.$(Level.SEVERE, "Vars: "+vars.toString());
// 			SurvivalGames.$(Level.SEVERE, "Vars Cache: "+varcache.toString());
// 		}
// 		return msg;
// 	}
// 
// 	public static String replaceVars(String msg, String[] vars){
// 		for(String str: vars){
// 			String[] s = str.split("-");
// 			varcache.put(s[0], s[1]);
// 		}
// 		boolean error = false;
// 		for(String str: varcache.keySet()){
// 			try{
// 				msg = msg.replace("{$"+str+"}", varcache.get(str));
// 			}catch(Exception e){
// 				SurvivalGames.$(Level.WARNING,"Failed to replace string vars. Error on "+str);
// 				error = true;
// 			}
// 		}
// 		if(error){
// 			SurvivalGames.$(Level.SEVERE, "Error replacing vars in message: "+msg);
// 			SurvivalGames.$(Level.SEVERE, "Vars: "+Arrays.toString(vars));
// 			SurvivalGames.$(Level.SEVERE, "Vars Cache: "+varcache.toString());
// 		}
// 
// 		return msg;
// 	}
// }


import java.util.HashMap;
import java.util.logging.Logger;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import com.thundergemios10.survivalgames.util.MessageUtil;
package com.thundergemios10.survivalgames;





public class MessageManager {

	public static MessageManager instance = new MessageManager();
	public String pre = ChatColor.BLUE + "" + ChatColor.BOLD + "[" + ChatColor.GOLD + "" + ChatColor.BOLD + "SG" + ChatColor.BLUE + "" + ChatColor.BOLD + "] " + ChatColor.RESET;
	private HashMap<PrefixType, String>prefix = new HashMap<PrefixType, String>();
	public enum PrefixType {

		MAIN, INFO, WARNING, ERROR;
		
	}
	
	public static MessageManager getInstance() {
		return instance;
	}
	
	public void setup() {
		FileConfiguration f = SettingsManager.getInstance().getMessageConfig();
// Path: src/main/java/com/thundergemios10/survivalgames/util/MessageUtil.java
// public class MessageUtil {
// 
// 	private static HashMap<String, String>varcache = new HashMap<String, String>();
// 
// 
// 	public static String replaceColors(String s){
// 		if(s == null){
// 			return null;
// 		}
// 		return s.replaceAll("(&([a-fk-or0-9]))", "\u00A7$2");
// 	}
// 
// 	public static String replaceVars(String msg, HashMap<String, String>vars){
// 		boolean error = false;
// 		for(String s:vars.keySet()){
// 			try{
// 				msg.replace("{$"+s+"}", vars.get(s));
// 			}catch(Exception e){
// 				SurvivalGames.$(Level.WARNING, "Failed to replace string vars. Error on "+s);
// 				error = true;
// 			}
// 		}
// 		if(error){
// 			SurvivalGames.$(Level.SEVERE, "Error replacing vars in message: "+msg);
// 			SurvivalGames.$(Level.SEVERE, "Vars: "+vars.toString());
// 			SurvivalGames.$(Level.SEVERE, "Vars Cache: "+varcache.toString());
// 		}
// 		return msg;
// 	}
// 
// 	public static String replaceVars(String msg, String[] vars){
// 		for(String str: vars){
// 			String[] s = str.split("-");
// 			varcache.put(s[0], s[1]);
// 		}
// 		boolean error = false;
// 		for(String str: varcache.keySet()){
// 			try{
// 				msg = msg.replace("{$"+str+"}", varcache.get(str));
// 			}catch(Exception e){
// 				SurvivalGames.$(Level.WARNING,"Failed to replace string vars. Error on "+str);
// 				error = true;
// 			}
// 		}
// 		if(error){
// 			SurvivalGames.$(Level.SEVERE, "Error replacing vars in message: "+msg);
// 			SurvivalGames.$(Level.SEVERE, "Vars: "+Arrays.toString(vars));
// 			SurvivalGames.$(Level.SEVERE, "Vars Cache: "+varcache.toString());
// 		}
// 
// 		return msg;
// 	}
// }


// Path: src/main/java/com/thundergemios10/survivalgames/MessageManager.java
import java.util.HashMap;
import java.util.logging.Logger;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import com.thundergemios10.survivalgames.util.MessageUtil;

package com.thundergemios10.survivalgames;





public class MessageManager {

	public static MessageManager instance = new MessageManager();
	public String pre = ChatColor.BLUE + "" + ChatColor.BOLD + "[" + ChatColor.GOLD + "" + ChatColor.BOLD + "SG" + ChatColor.BLUE + "" + ChatColor.BOLD + "] " + ChatColor.RESET;
	private HashMap<PrefixType, String>prefix = new HashMap<PrefixType, String>();
	public enum PrefixType {

		MAIN, INFO, WARNING, ERROR;
		
	}
	
	public static MessageManager getInstance() {
		return instance;
	}
	
	public void setup() {
		FileConfiguration f = SettingsManager.getInstance().getMessageConfig();
		prefix.put(PrefixType.MAIN, MessageUtil.replaceColors(f.getString("prefix.main")));