diff --git a/src/main/java/com/gamingmesh/jobs/ItemBoostManager.java b/src/main/java/com/gamingmesh/jobs/ItemBoostManager.java index 393c5769..100d15fd 100644 --- a/src/main/java/com/gamingmesh/jobs/ItemBoostManager.java +++ b/src/main/java/com/gamingmesh/jobs/ItemBoostManager.java @@ -228,7 +228,7 @@ public final class ItemBoostManager { } cfg.save(); - Jobs.consoleMsg("&e[Jobs] Loaded " + ITEMS.size() + " boosted items!"); + Jobs.consoleMsg("&eLoaded &6" + ITEMS.size() + " &eboosted items"); } /** diff --git a/src/main/java/com/gamingmesh/jobs/Jobs.java b/src/main/java/com/gamingmesh/jobs/Jobs.java index 737aa401..43a3348f 100644 --- a/src/main/java/com/gamingmesh/jobs/Jobs.java +++ b/src/main/java/com/gamingmesh/jobs/Jobs.java @@ -117,6 +117,7 @@ import net.Zrips.CMILib.Colors.CMIChatColor; import net.Zrips.CMILib.Container.PageInfo; import net.Zrips.CMILib.Items.CMIMaterial; import net.Zrips.CMILib.Logs.CMIDebug; +import net.Zrips.CMILib.Messages.CMIMessages; import net.Zrips.CMILib.RawMessages.RawMessage; import net.Zrips.CMILib.Version.Version; @@ -265,7 +266,7 @@ public final class Jobs extends JavaPlugin { try { if (Integer.parseInt(papi .getDescription().getVersion().replaceAll("[^\\d]", "")) >= 2100 && new PlaceholderAPIHook(this).register()) { - consoleMsg("&e[Jobs] PlaceholderAPI hooked."); + consoleMsg("&6PlaceholderAPI &ehooked."); } } catch (NumberFormatException ex) { return false; @@ -574,7 +575,7 @@ public final class Jobs extends JavaPlugin { getPlayerManager().addPlayerToCache(jPlayer); } if (!getPlayerManager().getPlayersCache().isEmpty()) - consoleMsg("&e[Jobs] Preloaded &6" + getPlayerManager().getPlayersCache().size() + " &eplayers data in &6" + ((int) ((System.currentTimeMillis() - time) / 1000.0D * 100.0D) / 100.0D)); + consoleMsg("&ePreloaded &6" + getPlayerManager().getPlayersCache().size() + " &eplayers data in &6" + ((int) ((System.currentTimeMillis() - time) / 1000.0D * 100.0D) / 100.0D)); } public static void convertDatabase() { @@ -722,8 +723,12 @@ public final class Jobs extends JavaPlugin { return versionCheckManager; } + private final static String prefix = "&6------------- &2Jobs &6-------------"; + private final static String suffix = "&6------------------------------------"; + @Override public void onEnable() { + CMIMessages.consoleMessage(prefix); instance = this; try { @@ -785,12 +790,14 @@ public final class Jobs extends JavaPlugin { getCommandManager().fillCommands(); getDBManager().getDB().triggerTableIdUpdate(); - consoleMsg("&e[Jobs] Plugin has been enabled successfully."); + consoleMsg("&ePlugin has been enabled successfully."); } catch (Throwable e) { e.printStackTrace(); System.out.println("There was some issues when starting plugin. Please contact dev about this. Plugin will be disabled."); setEnabled(false); } + + CMIMessages.consoleMessage(suffix); } public static void reload() { @@ -879,11 +886,12 @@ public final class Jobs extends JavaPlugin { getScheduleManager().start(); } else getScheduleManager().cancel(); - } @Override public void onDisable() { + + CMIMessages.consoleMessage(prefix); HandlerList.unregisterAll(this); if (dao != null) { @@ -907,6 +915,8 @@ public final class Jobs extends JavaPlugin { if (dao != null) { dao.closeConnections(); } + + CMIMessages.consoleMessage(suffix); } private static void checkDailyQuests(JobsPlayer jPlayer, Job job, ActionInfo info) { diff --git a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java index 4369e8ee..0c60e405 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java @@ -953,7 +953,7 @@ public class ConfigManager { Jobs.setJobs(jobs); if (!jobs.isEmpty()) { - Jobs.consoleMsg("&e[Jobs] Loaded " + jobs.size() + " jobs!"); + Jobs.consoleMsg("&eLoaded &6" + jobs.size() + " &ejobs"); } ItemBoostManager.load(); @@ -1461,13 +1461,13 @@ public class ConfigManager { quests.add(quest); } catch (Exception e) { - Jobs.consoleMsg("&c[Jobs] Can't load " + one + " quest for " + jobFullName); + Jobs.consoleMsg("&cCan't load &6" + one + " &cquest for &6" + jobFullName); e.printStackTrace(); } } job.setQuests(quests); - Jobs.consoleMsg("&e[Jobs] Loaded " + quests.size() + " quests for " + jobFullName); + Jobs.consoleMsg("&eLoaded &6" + quests.size() + " &equests for &6" + jobFullName); } job.setMaxDailyQuests(jobSection.getInt("maxDailyQuests", 1)); diff --git a/src/main/java/com/gamingmesh/jobs/config/ExploreManager.java b/src/main/java/com/gamingmesh/jobs/config/ExploreManager.java index b00ae6a2..6da9b8d5 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ExploreManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ExploreManager.java @@ -46,11 +46,11 @@ public class ExploreManager { if (!exploreEnabled) return; - Jobs.consoleMsg("&e[Jobs] Loading explorer data"); + Jobs.consoleMsg("&eLoading explorer data"); Jobs.getJobsDAO().loadExplore(); int size = getSize(); - Jobs.consoleMsg("&e[Jobs] Loaded explorer data" + (size != 0 ? " (" + size + ")" : ".")); + Jobs.consoleMsg("&eLoaded explorer data" + (size != 0 ? " (&6" + size + "&e)" : ".")); } public Map> getWorlds() { diff --git a/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java b/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java index e820048c..d1618296 100644 --- a/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java @@ -199,9 +199,9 @@ public class NameTranslatorManager { } if (listOfNames.size() > 0) - Jobs.consoleMsg("&e[Jobs] Loaded " + listOfNames.size() + " custom item names!"); + Jobs.consoleMsg("&eLoaded &6" + listOfNames.size() + " &ecustom item names"); } else - Jobs.consoleMsg("&c[Jobs] The ItemList section not found in " + itemFile.fileName + " file."); + Jobs.consoleMsg("&cThe ItemList section not found in &6" + itemFile.fileName + " &cfile."); if ((section = itemFile.getConfig().getConfigurationSection("EntityList")) != null) { listOfEntities.clear(); @@ -220,9 +220,9 @@ public class NameTranslatorManager { } if (listOfEntities.size() > 0) - Jobs.consoleMsg("&e[Jobs] Loaded " + listOfEntities.size() + " custom entity names!"); + Jobs.consoleMsg("&eLoaded &6" + listOfEntities.size() + " &ecustom entity names"); } else - Jobs.consoleMsg("&c[Jobs] The EntityList section not found in " + itemFile.fileName + " file."); + Jobs.consoleMsg("&cThe EntityList section not found in &6" + itemFile.fileName + " &cfile."); if ((section = itemFile.getConfig().getConfigurationSection("MythicEntityList")) != null) { listOfMMEntities.clear(); @@ -233,9 +233,9 @@ public class NameTranslatorManager { } if (listOfMMEntities.size() > 0) - Jobs.consoleMsg("&e[Jobs] Loaded " + listOfMMEntities.size() + " custom MythicMobs names!"); + Jobs.consoleMsg("&eLoaded &6" + listOfMMEntities.size() + " &ecustom MythicMobs names"); } else - Jobs.consoleMsg("&c[Jobs] The MythicEntityList section not found in " + itemFile.fileName + " file."); + Jobs.consoleMsg("&cThe MythicEntityList section not found in &6" + itemFile.fileName + " &cfile."); if ((section = itemFile.getConfig().getConfigurationSection("EnchantList")) != null) { listOfEnchants.clear(); @@ -245,9 +245,9 @@ public class NameTranslatorManager { } if (listOfEnchants.size() > 0) - Jobs.consoleMsg("&e[Jobs] Loaded " + listOfEnchants.size() + " custom enchant names!"); + Jobs.consoleMsg("&eLoaded &6" + listOfEnchants.size() + " &ecustom enchant names"); } else - Jobs.consoleMsg("&c[Jobs] The EnchantList section not found in " + itemFile.fileName + " file."); + Jobs.consoleMsg("&cThe EnchantList section not found in &6" + itemFile.fileName + " &cfile."); if ((section = itemFile.getConfig().getConfigurationSection("ColorList")) != null) { listOfColors.clear(); @@ -260,9 +260,9 @@ public class NameTranslatorManager { } if (listOfColors.size() > 0) - Jobs.consoleMsg("&e[Jobs] Loaded " + listOfColors.size() + " custom color names!"); + Jobs.consoleMsg("&eLoaded &6" + listOfColors.size() + " &ecustom color names"); } else - Jobs.consoleMsg("&c[Jobs] The ColorList section not found in " + itemFile.fileName + " file."); + Jobs.consoleMsg("&cThe ColorList section not found in &6" + itemFile.fileName + " &cfile."); } @SuppressWarnings("deprecation") diff --git a/src/main/java/com/gamingmesh/jobs/config/RestrictedBlockManager.java b/src/main/java/com/gamingmesh/jobs/config/RestrictedBlockManager.java index 81ea53c4..bd2bd013 100644 --- a/src/main/java/com/gamingmesh/jobs/config/RestrictedBlockManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/RestrictedBlockManager.java @@ -45,7 +45,7 @@ public class RestrictedBlockManager { CMIMaterial mat = cm == null ? null : cm.getCMIType(); if (mat == null || !mat.isBlock()) { - Jobs.consoleMsg("&e[Jobs] Your defined (" + one + ") protected block id/name is not correct!"); + Jobs.consoleMsg("&eYour defined (&6" + one + "&e) protected block id/name is not correct!"); continue; } @@ -78,7 +78,7 @@ public class RestrictedBlockManager { int size = restrictedBlocksTimer.size(); if (size > 0) - Jobs.consoleMsg("&e[Jobs] Loaded " + size + " protected blocks timers!"); + Jobs.consoleMsg("&eLoaded &6" + size + " &eprotected blocks timers"); cfg.save(); } diff --git a/src/main/java/com/gamingmesh/jobs/config/ShopManager.java b/src/main/java/com/gamingmesh/jobs/config/ShopManager.java index 323d3f4e..c0e75b4b 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ShopManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ShopManager.java @@ -470,6 +470,6 @@ public class ShopManager { } if (!list.isEmpty()) - Jobs.consoleMsg("&e[Jobs] Loaded " + list.size() + " shop items!"); + Jobs.consoleMsg("&eLoaded &6" + list.size() + " &eshop items"); } } diff --git a/src/main/java/com/gamingmesh/jobs/config/TitleManager.java b/src/main/java/com/gamingmesh/jobs/config/TitleManager.java index 301e6b28..d46b0293 100644 --- a/src/main/java/com/gamingmesh/jobs/config/TitleManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/TitleManager.java @@ -157,6 +157,6 @@ public class TitleManager { int size = titles.size(); if (size > 0) - Jobs.consoleMsg("&e[Jobs] Loaded " + size + " titles!"); + Jobs.consoleMsg("&eLoaded &6" + size + " &etitles"); } } diff --git a/src/main/java/com/gamingmesh/jobs/container/blockOwnerShip/BlockOwnerShip.java b/src/main/java/com/gamingmesh/jobs/container/blockOwnerShip/BlockOwnerShip.java index 07f80b06..3c359874 100644 --- a/src/main/java/com/gamingmesh/jobs/container/blockOwnerShip/BlockOwnerShip.java +++ b/src/main/java/com/gamingmesh/jobs/container/blockOwnerShip/BlockOwnerShip.java @@ -324,7 +324,7 @@ public class BlockOwnerShip { } if (total > 0) { - Jobs.consoleMsg("&e[Jobs] Loaded " + total + " " + path.toLowerCase() + " for reassigning."); + Jobs.consoleMsg("&eLoaded &6" + total + " " + path.toLowerCase() + " &efor reassigning."); } } diff --git a/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java b/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java index 2ac701f0..7142917f 100644 --- a/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java +++ b/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java @@ -485,7 +485,7 @@ public abstract class JobsDAO { return; } - CMIMessages.consoleMessage("&2Connected to database (" + dbType + ")"); + CMIMessages.consoleMessage("&eConnected to database (&6" + dbType + "&e)"); vacuum(); diff --git a/src/main/java/com/gamingmesh/jobs/dao/JobsMySQL.java b/src/main/java/com/gamingmesh/jobs/dao/JobsMySQL.java index c3be73a6..4eab676e 100644 --- a/src/main/java/com/gamingmesh/jobs/dao/JobsMySQL.java +++ b/src/main/java/com/gamingmesh/jobs/dao/JobsMySQL.java @@ -8,32 +8,17 @@ import java.sql.Statement; import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.dao.JobsManager.DataBaseType; -import net.Zrips.CMILib.Messages.CMIMessages; - public class JobsMySQL extends JobsDAO { - + private static String path = ""; static { - try { Class.forName("com.mysql.cj.jdbc.Driver"); path = "com.mysql.cj.jdbc.Driver"; } catch (Throwable e) { path = "com.mysql.jdbc.Driver"; } - - String major = ""; - - String[] javaVersionElements = System.getProperty("java.runtime.version").split("\\.|_|-b"); - try { - major = javaVersionElements[0]; - } catch (Throwable e) { - String d = System.getProperty("java.version"); - String[] s = d.split("_")[0].split("."); - major = s[1]; - } - CMIMessages.consoleMessage("Detected Java" + major); } JobsMySQL(Jobs plugin, String hostname, String database, String username, String password, String prefix, boolean certificate, boolean ssl, boolean autoReconnect, diff --git a/src/main/java/com/gamingmesh/jobs/tasks/BufferedPaymentThread.java b/src/main/java/com/gamingmesh/jobs/tasks/BufferedPaymentThread.java index c4019683..a69e9980 100644 --- a/src/main/java/com/gamingmesh/jobs/tasks/BufferedPaymentThread.java +++ b/src/main/java/com/gamingmesh/jobs/tasks/BufferedPaymentThread.java @@ -33,7 +33,7 @@ public class BufferedPaymentThread extends Thread { @Override public void run() { - Jobs.consoleMsg("&e[Jobs] Started buffered payment thread."); + Jobs.consoleMsg("&eStarted buffered payment thread."); while (running) { try { @@ -52,7 +52,7 @@ public class BufferedPaymentThread extends Thread { running = false; } } - Jobs.consoleMsg("&e[Jobs] Buffered payment thread shutdown."); + Jobs.consoleMsg("&eBuffered payment thread shutdown."); } public void shutdown() { diff --git a/src/main/java/com/gamingmesh/jobs/tasks/DatabaseSaveThread.java b/src/main/java/com/gamingmesh/jobs/tasks/DatabaseSaveThread.java index e5ae6e2c..d53325e0 100644 --- a/src/main/java/com/gamingmesh/jobs/tasks/DatabaseSaveThread.java +++ b/src/main/java/com/gamingmesh/jobs/tasks/DatabaseSaveThread.java @@ -33,7 +33,7 @@ public class DatabaseSaveThread extends Thread { @Override public void run() { - Jobs.consoleMsg("&e[Jobs] Started database save task."); + Jobs.consoleMsg("&eStarted database save task."); while (running) { try { @@ -51,7 +51,7 @@ public class DatabaseSaveThread extends Thread { } } - Jobs.consoleMsg("&e[Jobs] Database save task shutdown!"); + Jobs.consoleMsg("&eDatabase save task shutdown!"); }