diff --git a/src/main/java/me/totalfreedom/plex/Plex.java b/src/main/java/me/totalfreedom/plex/Plex.java index 184965f..8ce3824 100644 --- a/src/main/java/me/totalfreedom/plex/Plex.java +++ b/src/main/java/me/totalfreedom/plex/Plex.java @@ -13,6 +13,7 @@ import me.totalfreedom.plex.storage.MongoConnection; import me.totalfreedom.plex.storage.RedisConnection; import me.totalfreedom.plex.storage.SQLConnection; import me.totalfreedom.plex.storage.StorageType; +import me.totalfreedom.plex.util.PlexLog; import me.totalfreedom.plex.util.PlexUtils; import org.bukkit.plugin.java.JavaPlugin; @@ -66,8 +67,17 @@ public class Plex extends JavaPlugin public void onEnable() { config.load(); + PlexLog.log("Loaded config.yml"); + + try { + PlexUtils.testConnections(); + PlexLog.log("Connected to " + storageType.name().toUpperCase()); + } catch (Exception e) + { + PlexLog.error("Failed to connect to " + storageType.name().toUpperCase()); + e.printStackTrace(); + } - PlexUtils.testConnections(); if (storageType == StorageType.MONGO) { @@ -84,6 +94,7 @@ public class Plex extends JavaPlugin rankManager = new RankManager(); rankManager.generateDefaultRanks(); rankManager.importDefaultRanks(); + PlexLog.log("Rank Manager initialized"); } diff --git a/src/main/java/me/totalfreedom/plex/rank/enums/Rank.java b/src/main/java/me/totalfreedom/plex/rank/enums/Rank.java index 782dc34..e726836 100644 --- a/src/main/java/me/totalfreedom/plex/rank/enums/Rank.java +++ b/src/main/java/me/totalfreedom/plex/rank/enums/Rank.java @@ -29,12 +29,12 @@ public enum Rank public String getPrefix() { - return prefix; + return ChatColor.translateAlternateColorCodes('&', prefix); } public String getLoginMSG() { - return loginMessage; + return ChatColor.translateAlternateColorCodes('&', loginMessage); } public int getLevel() { diff --git a/src/main/java/me/totalfreedom/plex/util/PlexLog.java b/src/main/java/me/totalfreedom/plex/util/PlexLog.java index 1bb7329..8d506b8 100644 --- a/src/main/java/me/totalfreedom/plex/util/PlexLog.java +++ b/src/main/java/me/totalfreedom/plex/util/PlexLog.java @@ -1,16 +1,17 @@ package me.totalfreedom.plex.util; -import me.totalfreedom.plex.Plex; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; public class PlexLog { public static void log(String message) { - Plex.get().getServer().getConsoleSender().sendMessage(String.format("§e[Plex] §7%s", message)); + Bukkit.getConsoleSender().sendMessage(String.format(ChatColor.YELLOW + "[Plex] " + ChatColor.GRAY + "%s", message)); } public static void error(String message) { - Plex.get().getServer().getConsoleSender().sendMessage(String.format("§c[Plex Error] §6%s", message)); + Bukkit.getConsoleSender().sendMessage(String.format(ChatColor.RED + "[Plex Error]" + ChatColor.GOLD + "%s", message)); } }