From afa292986d340d4d63a489f942f342aea01cb026 Mon Sep 17 00:00:00 2001 From: Florian CUNY Date: Wed, 3 Jan 2018 21:57:32 +0100 Subject: [PATCH] Removed the cache from BSBLocale because YAMLConfiguration is a cache itself. --- .../bskyblock/api/localization/BSBLocale.java | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/main/java/us/tastybento/bskyblock/api/localization/BSBLocale.java b/src/main/java/us/tastybento/bskyblock/api/localization/BSBLocale.java index 3afe9d489..95f4fee56 100644 --- a/src/main/java/us/tastybento/bskyblock/api/localization/BSBLocale.java +++ b/src/main/java/us/tastybento/bskyblock/api/localization/BSBLocale.java @@ -15,12 +15,10 @@ public class BSBLocale { private Locale locale; private YamlConfiguration config; - private Map cache; public BSBLocale(Locale locale, File file) { this.locale = locale; this.config = YamlConfiguration.loadConfiguration(file); - this.cache = new HashMap<>(); } /** @@ -29,19 +27,12 @@ public class BSBLocale { * @return Text for this locale reference or the reference if nothing has been found */ public String get(String reference) { - if (cache.containsKey(reference)) { - return cache.get(reference); - } else if (config.contains(reference)) { - cache.put(reference, ChatColor.translateAlternateColorCodes('&', config.getString(reference))); - return cache.get(reference); + if (config.contains(reference)) { + return config.getString(reference); } return reference; // return reference in case nothing has been found } - public void clearCache() { - this.cache.clear(); - } - /** * Returns the locale language * @return the locale language