From 0fb849abcac36a268800383f3febaf1fa5d91d7f Mon Sep 17 00:00:00 2001 From: Zrips Date: Mon, 15 Oct 2018 13:36:13 +0300 Subject: [PATCH] Correct enchant name translation --- .../jobs/config/NameTranslatorManager.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java b/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java index e2dcbf0d..9d8dc0c2 100644 --- a/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java @@ -15,6 +15,7 @@ import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial; import com.gamingmesh.jobs.container.JobInfo; import com.gamingmesh.jobs.container.LocaleReader; import com.gamingmesh.jobs.container.NameList; +import com.gamingmesh.jobs.stuff.Debug; public class NameTranslatorManager { @@ -86,22 +87,24 @@ public class NameTranslatorManager { case ENCHANT: for (NameList one : ListOfEnchants) { String ids = one.getId(); + ids = one.getMinecraftName(); + if (ids.equalsIgnoreCase(info.getName().contains(":") ? info.getName().split(":")[0] : info.getName())) { + return one.getName() + (info.getName().contains(":") ? ":" + info.getName().split(":")[1] : ""); + } + if (ids.equalsIgnoreCase(String.valueOf(info.getId()))) { return one.getName() + " " + info.getMeta(); } - } - for (NameList one : ListOfNames) { - String ids = one.getId() + ":" + one.getMeta(); + ids = one.getId() + ":" + one.getMeta(); if (!one.getMeta().equalsIgnoreCase("") && ids.equalsIgnoreCase(info.getId() + ":" + info.getMeta()) && !one.getId().equalsIgnoreCase("0")) { return one.getName(); } - } - for (NameList one : ListOfNames) { - String ids = one.getId(); + ids = one.getId(); if (ids.equalsIgnoreCase(String.valueOf(info.getId())) && !one.getId().equalsIgnoreCase("0")) { return one.getName(); } } + break; case CUSTOMKILL: case EXPLORE: