mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-28 05:35:44 +01:00
Fixes reload bug when locale folder is missing.
https://github.com/BentoBoxWorld/bentobox/issues/385
This commit is contained in:
parent
3b87ff7aae
commit
b556b7160e
@ -27,11 +27,12 @@ public class LocalesManager {
|
||||
private BentoBox plugin;
|
||||
private Map<Locale, BentoBoxLocale> languages = new HashMap<>();
|
||||
private static final String LOCALE_FOLDER = "locales";
|
||||
private static final String BENTOBOX = "BentoBox";
|
||||
|
||||
public LocalesManager(BentoBox plugin) {
|
||||
this.plugin = plugin;
|
||||
copyLocalesFromJar(plugin.getName());
|
||||
loadLocalesFromFile(plugin.getName()); // Default
|
||||
copyLocalesFromJar(BENTOBOX);
|
||||
loadLocalesFromFile(BENTOBOX); // Default
|
||||
}
|
||||
|
||||
/**
|
||||
@ -170,6 +171,7 @@ public class LocalesManager {
|
||||
*/
|
||||
public void reloadLanguages() {
|
||||
languages.clear();
|
||||
copyLocalesFromJar(plugin.getName());
|
||||
loadLocalesFromFile(plugin.getName());
|
||||
plugin.getAddonsManager().getAddons().forEach(addon -> loadLocalesFromFile(addon.getDescription().getName()));
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ import world.bentobox.bentobox.util.Util;
|
||||
@PrepareForTest( { Bukkit.class, BentoBox.class, Util.class, Location.class })
|
||||
public class IslandsManagerTest {
|
||||
|
||||
private static BentoBox plugin;
|
||||
private BentoBox plugin;
|
||||
private UUID uuid;
|
||||
private User user;
|
||||
private PlayersManager pm;
|
||||
|
Loading…
Reference in New Issue
Block a user