mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-28 13:45:14 +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 BentoBox plugin;
|
||||||
private Map<Locale, BentoBoxLocale> languages = new HashMap<>();
|
private Map<Locale, BentoBoxLocale> languages = new HashMap<>();
|
||||||
private static final String LOCALE_FOLDER = "locales";
|
private static final String LOCALE_FOLDER = "locales";
|
||||||
|
private static final String BENTOBOX = "BentoBox";
|
||||||
|
|
||||||
public LocalesManager(BentoBox plugin) {
|
public LocalesManager(BentoBox plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
copyLocalesFromJar(plugin.getName());
|
copyLocalesFromJar(BENTOBOX);
|
||||||
loadLocalesFromFile(plugin.getName()); // Default
|
loadLocalesFromFile(BENTOBOX); // Default
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -170,6 +171,7 @@ public class LocalesManager {
|
|||||||
*/
|
*/
|
||||||
public void reloadLanguages() {
|
public void reloadLanguages() {
|
||||||
languages.clear();
|
languages.clear();
|
||||||
|
copyLocalesFromJar(plugin.getName());
|
||||||
loadLocalesFromFile(plugin.getName());
|
loadLocalesFromFile(plugin.getName());
|
||||||
plugin.getAddonsManager().getAddons().forEach(addon -> loadLocalesFromFile(addon.getDescription().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 })
|
@PrepareForTest( { Bukkit.class, BentoBox.class, Util.class, Location.class })
|
||||||
public class IslandsManagerTest {
|
public class IslandsManagerTest {
|
||||||
|
|
||||||
private static BentoBox plugin;
|
private BentoBox plugin;
|
||||||
private UUID uuid;
|
private UUID uuid;
|
||||||
private User user;
|
private User user;
|
||||||
private PlayersManager pm;
|
private PlayersManager pm;
|
||||||
|
Loading…
Reference in New Issue
Block a user