1
0
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:
montlikadani 2020-01-28 17:18:13 +01:00
parent 8e08543d83
commit 8f067f4646
5 changed files with 18 additions and 23 deletions

View File

@ -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();

View File

@ -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();
}
});

View File

@ -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());

View File

@ -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;

View File

@ -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;