diff --git a/src/main/java/com/gamingmesh/jobs/Jobs.java b/src/main/java/com/gamingmesh/jobs/Jobs.java index f4af939b..b9dc7377 100644 --- a/src/main/java/com/gamingmesh/jobs/Jobs.java +++ b/src/main/java/com/gamingmesh/jobs/Jobs.java @@ -495,11 +495,7 @@ public class Jobs extends JavaPlugin { * @throws IOException */ public void startup() { - try { - reload(true); - } catch (IOException e1) { - e1.printStackTrace(); - } + reload(true); loadAllPlayersData(); // add all online players for (Player online : Bukkit.getServer().getOnlinePlayers()) { @@ -541,10 +537,6 @@ public class Jobs extends JavaPlugin { ((int) (((System.currentTimeMillis() - time) / 1000d) * 100) / 100D)); } - public static void reload() throws IOException { - reload(false); - } - /** * Executes clean shutdown */ @@ -752,11 +744,14 @@ public class Jobs extends JavaPlugin { } } + public static void reload() { + reload(false); + } + /** * Reloads all data - * @throws IOException */ - public static void reload(boolean startup) throws IOException { + public static void reload(boolean startup) { // unregister all registered listeners by this plugin and register again if (!startup) { org.bukkit.plugin.PluginManager pm = getInstance().getServer().getPluginManager(); @@ -795,7 +790,11 @@ public class Jobs extends JavaPlugin { getGCManager().reload(); getLanguage().reload(); - getConfigManager().reload(); + try { + getConfigManager().reload(); + } catch (IOException e) { + e.printStackTrace(); + } getDBManager().getDB().loadAllJobsWorlds(); getDBManager().getDB().loadAllJobsNames(); diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/convert.java b/src/main/java/com/gamingmesh/jobs/commands/list/convert.java index 17926bbc..4d72e4f2 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/convert.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/convert.java @@ -1,6 +1,5 @@ package com.gamingmesh.jobs.commands.list; -import java.io.IOException; import java.sql.SQLException; import java.util.List; @@ -63,12 +62,8 @@ public class convert implements Cmd { return; } - try { - Jobs.reload(); - Jobs.loadAllPlayersData(); - } catch (IOException e) { - e.printStackTrace(); - } + Jobs.reload(); + Jobs.loadAllPlayersData(); } }); diff --git a/src/main/java/com/gamingmesh/jobs/hooks/HookManager.java b/src/main/java/com/gamingmesh/jobs/hooks/HookManager.java index 09e850fa..d0b97605 100644 --- a/src/main/java/com/gamingmesh/jobs/hooks/HookManager.java +++ b/src/main/java/com/gamingmesh/jobs/hooks/HookManager.java @@ -73,10 +73,9 @@ public class HookManager { } private static void setMythicManager() { - if (pm.getPlugin("MythicMobs") == null) return; - + try { Class.forName("net.elseland.xikage.MythicMobs.API.MythicMobsAPI"); MythicManager = new MythicMobs2(Jobs.getInstance()); diff --git a/src/main/java/com/gamingmesh/jobs/hooks/MythicMobs/MythicMobs4Listener.java b/src/main/java/com/gamingmesh/jobs/hooks/MythicMobs/MythicMobs4Listener.java index aa7ef353..a2cecb96 100644 --- a/src/main/java/com/gamingmesh/jobs/hooks/MythicMobs/MythicMobs4Listener.java +++ b/src/main/java/com/gamingmesh/jobs/hooks/MythicMobs/MythicMobs4Listener.java @@ -11,7 +11,6 @@ import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.actions.MMKillInfo; import com.gamingmesh.jobs.container.ActionType; import com.gamingmesh.jobs.container.JobsPlayer; -import com.gamingmesh.jobs.stuff.Debug; import io.lumine.xikage.mythicmobs.api.bukkit.events.MythicMobDeathEvent; import io.lumine.xikage.mythicmobs.mobs.MythicMob; diff --git a/src/main/java/com/gamingmesh/jobs/i18n/Language.java b/src/main/java/com/gamingmesh/jobs/i18n/Language.java index 561b3759..9357af67 100644 --- a/src/main/java/com/gamingmesh/jobs/i18n/Language.java +++ b/src/main/java/com/gamingmesh/jobs/i18n/Language.java @@ -44,7 +44,10 @@ public class Language { * Reloads the config */ public void reload() { - customlocale = new YmlMaker(plugin, "locale/messages_" + Jobs.getGCManager().localeString + ".yml").getConfig(); + String ls = Jobs.getGCManager().localeString.toLowerCase(); + if (!ls.equals("en")) { + customlocale = new YmlMaker(plugin, "locale/messages_" + ls + ".yml").getConfig(); + } enlocale = new YmlMaker(plugin, "locale/messages_en.yml").getConfig(); if (customlocale == null) customlocale = enlocale;