mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-26 12:35:28 +01:00
Fixed FileNotFoundException when using "en" locale
This commit is contained in:
parent
8e08543d83
commit
8f067f4646
@ -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();
|
||||
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -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());
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user