mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-23 01:27:37 +00:00
my colors in cmd prompt don't work :(
This commit is contained in:
parent
e716cee5bc
commit
ed1abb1fc0
@ -13,6 +13,7 @@ import me.totalfreedom.plex.storage.MongoConnection;
|
|||||||
import me.totalfreedom.plex.storage.RedisConnection;
|
import me.totalfreedom.plex.storage.RedisConnection;
|
||||||
import me.totalfreedom.plex.storage.SQLConnection;
|
import me.totalfreedom.plex.storage.SQLConnection;
|
||||||
import me.totalfreedom.plex.storage.StorageType;
|
import me.totalfreedom.plex.storage.StorageType;
|
||||||
|
import me.totalfreedom.plex.util.PlexLog;
|
||||||
import me.totalfreedom.plex.util.PlexUtils;
|
import me.totalfreedom.plex.util.PlexUtils;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
@ -66,8 +67,17 @@ public class Plex extends JavaPlugin
|
|||||||
public void onEnable()
|
public void onEnable()
|
||||||
{
|
{
|
||||||
config.load();
|
config.load();
|
||||||
|
PlexLog.log("Loaded config.yml");
|
||||||
|
|
||||||
|
try {
|
||||||
PlexUtils.testConnections();
|
PlexUtils.testConnections();
|
||||||
|
PlexLog.log("Connected to " + storageType.name().toUpperCase());
|
||||||
|
} catch (Exception e)
|
||||||
|
{
|
||||||
|
PlexLog.error("Failed to connect to " + storageType.name().toUpperCase());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (storageType == StorageType.MONGO)
|
if (storageType == StorageType.MONGO)
|
||||||
{
|
{
|
||||||
@ -84,6 +94,7 @@ public class Plex extends JavaPlugin
|
|||||||
rankManager = new RankManager();
|
rankManager = new RankManager();
|
||||||
rankManager.generateDefaultRanks();
|
rankManager.generateDefaultRanks();
|
||||||
rankManager.importDefaultRanks();
|
rankManager.importDefaultRanks();
|
||||||
|
PlexLog.log("Rank Manager initialized");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,12 +29,12 @@ public enum Rank
|
|||||||
|
|
||||||
public String getPrefix()
|
public String getPrefix()
|
||||||
{
|
{
|
||||||
return prefix;
|
return ChatColor.translateAlternateColorCodes('&', prefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLoginMSG()
|
public String getLoginMSG()
|
||||||
{
|
{
|
||||||
return loginMessage;
|
return ChatColor.translateAlternateColorCodes('&', loginMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getLevel() {
|
public int getLevel() {
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
package me.totalfreedom.plex.util;
|
package me.totalfreedom.plex.util;
|
||||||
|
|
||||||
import me.totalfreedom.plex.Plex;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
public class PlexLog
|
public class PlexLog
|
||||||
{
|
{
|
||||||
public static void log(String message)
|
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)
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user