Wire up locale config

This commit is contained in:
nossr50 2019-03-19 08:10:08 -07:00
parent 45430d9c25
commit 883fca3cf3
3 changed files with 3 additions and 3 deletions

View File

@ -183,7 +183,7 @@ public enum PrimarySkillType {
} }
public static PrimarySkillType getSkill(String skillName) { public static PrimarySkillType getSkill(String skillName) {
if (!MainConfig.getInstance().getLocale().equalsIgnoreCase("en_US")) { if (!mcMMO.getConfigManager().getConfigLanguage().getTargetLanguage().equalsIgnoreCase("en_US")) {
for (PrimarySkillType type : values()) { for (PrimarySkillType type : values()) {
if (skillName.equalsIgnoreCase(LocaleLoader.getString(StringUtils.getCapitalized(type.name()) + ".SkillName"))) { if (skillName.equalsIgnoreCase(LocaleLoader.getString(StringUtils.getCapitalized(type.name()) + ".SkillName"))) {
return type; return type;

View File

@ -844,7 +844,7 @@ public class PlayerListener implements Listener {
*/ */
@EventHandler(priority = EventPriority.LOWEST) @EventHandler(priority = EventPriority.LOWEST)
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) { public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
if (!MainConfig.getInstance().getLocale().equalsIgnoreCase("en_US")) { if (!mcMMO.getConfigManager().getConfigLanguage().getTargetLanguage().equalsIgnoreCase("en_US")) {
String message = event.getMessage(); String message = event.getMessage();
String command = message.substring(1).split(" ")[0]; String command = message.substring(1).split(" ")[0];
String lowerCaseCommand = command.toLowerCase(); String lowerCaseCommand = command.toLowerCase();

View File

@ -112,7 +112,7 @@ public class SkillUtils {
* @return true if this is a valid skill, false otherwise * @return true if this is a valid skill, false otherwise
*/ */
public static boolean isSkill(String skillName) { public static boolean isSkill(String skillName) {
return MainConfig.getInstance().getLocale().equalsIgnoreCase("en_US") ? PrimarySkillType.getSkill(skillName) != null : isLocalizedSkill(skillName); return mcMMO.getConfigManager().getConfigLanguage().getTargetLanguage().equalsIgnoreCase("en_US") ? PrimarySkillType.getSkill(skillName) != null : isLocalizedSkill(skillName);
} }
public static void sendSkillMessage(Player player, NotificationType notificationType, String key) { public static void sendSkillMessage(Player player, NotificationType notificationType, String key) {