diff --git a/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java b/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java index 415f79f7..f5604dc3 100644 --- a/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java @@ -2,19 +2,14 @@ package com.gamingmesh.jobs.config; import java.io.File; import java.io.IOException; -import java.net.URISyntaxException; -import java.net.URL; -import java.net.URLClassLoader; import java.util.ArrayList; -import java.util.Enumeration; import java.util.List; import java.util.Set; -import java.util.jar.JarEntry; -import java.util.jar.JarFile; import org.bukkit.Bukkit; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; + import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.container.JobInfo; import com.gamingmesh.jobs.container.LocaleReader; @@ -35,7 +30,6 @@ public class NameTranslatorManager { } public String Translate(String materialName, JobInfo info) { - // Translating name to user friendly if (Jobs.getGCManager().UseCustomNames) switch (info.getActionType()) { @@ -49,6 +43,13 @@ public class NameTranslatorManager { case REPAIR: case BREW: case FISH: + + for (NameList one : ListOfNames) { + String ids = one.getName(); + if (ids.equalsIgnoreCase(materialName)) { + return one.getName(); + } + } for (NameList one : ListOfNames) { String ids = one.getId() + ":" + one.getMeta(); if (!one.getMeta().equalsIgnoreCase("") && ids.equalsIgnoreCase(info.getId() + ":" + info.getMeta()) && !one.getId().equalsIgnoreCase("0")) { @@ -169,7 +170,6 @@ public class NameTranslatorManager { Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "[Jobs] Loaded " + ListOfColors.size() + " custom color names!"); } - synchronized void load() { File file = new File(plugin.getDataFolder(), "TranslatableWords.yml"); @@ -179,7 +179,7 @@ public class NameTranslatorManager { // Just copying default language files, except en, that one will be generated List languages = new ArrayList(); - + try { languages.addAll(LanguageManager.getClassesFromPackage("TranslatableWords", "Words_")); } catch (ClassNotFoundException e1) {