diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/CMIMaterial.java b/src/main/java/com/gamingmesh/jobs/CMILib/CMIMaterial.java index 6849ee2a..8da291f7 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/CMIMaterial.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/CMIMaterial.java @@ -10,6 +10,7 @@ import org.bukkit.block.Block; import org.bukkit.block.Skull; import org.bukkit.inventory.ItemStack; +import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.CMILib.ItemManager.SlabType; import com.gamingmesh.jobs.CMILib.VersionChecker.Version; import com.gamingmesh.jobs.stuff.Debug; @@ -1059,7 +1060,7 @@ public enum CMIMaterial { LEGACY_DIODE_BLOCK_OFF(93, 0, null, "Diode Block Off"), LEGACY_DIODE_BLOCK_ON(94, 0, null, "Diode Block On"), LEGACY_BREWING_STAND(117, null, null, "LEGACY_BREWING_STAND"), - + // LEGACY_CAULDRON(118, 0, null, "LEGACY_CAULDRON", ""), // LEGACY_REDSTONE_LAMP_ON(124, null, null, "LEGACY_REDSTONE_LAMP_ON", ""), // LEGACY_WOOD_DOUBLE_STEP(125, null, null, "LEGACY_WOOD_DOUBLE_STEP", ""), @@ -1288,6 +1289,8 @@ public enum CMIMaterial { try { ids = Integer.parseInt(id.split(":")[0]); data = Integer.parseInt(id.split(":")[1]); + if (ids <= 0) + return CMIMaterial.NONE; return get(ids, data); } catch (Exception ex) { } @@ -1300,7 +1303,7 @@ public enum CMIMaterial { return mat; } CMIMaterial mat1 = ItemManager.byName.get(id); - if (mat1 != null) { + if (mat1 != null && mat1.getLegacyId() > 0) { mat = get(mat1.getLegacyId(), data); if (mat != null) { return mat; diff --git a/src/main/java/com/gamingmesh/jobs/commands/JobsCommands.java b/src/main/java/com/gamingmesh/jobs/commands/JobsCommands.java index 2a8dadba..29aebbbc 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/JobsCommands.java +++ b/src/main/java/com/gamingmesh/jobs/commands/JobsCommands.java @@ -24,6 +24,7 @@ import com.gamingmesh.jobs.container.JobInfo; import com.gamingmesh.jobs.container.JobProgression; import com.gamingmesh.jobs.container.JobsPlayer; import com.gamingmesh.jobs.container.Title; +import com.gamingmesh.jobs.stuff.Debug; import com.gamingmesh.jobs.stuff.PageInfo; import com.gamingmesh.jobs.stuff.Sorting; import com.gamingmesh.jobs.stuff.Util; diff --git a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java index 8088751b..b20d1f14 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java @@ -1161,6 +1161,7 @@ public class ConfigManager { } } } + break; default: break; diff --git a/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java b/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java index 341d65c0..c5c527c7 100644 --- a/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java @@ -51,12 +51,13 @@ public class NameTranslatorManager { case BREW: case FISH: case STRIPLOGS: + materialName = materialName.replace(" ", ""); - CMIMaterial mat = CMIMaterial.get(materialName); + CMIMaterial mat = CMIMaterial.get(materialName.replace(" ", "")); NameList nameLs = ListOfNames.get(mat); if (nameLs == null) { return mat.getName(); - } + } if (meta != null && !meta.isEmpty()) { mat = CMIMaterial.get(materialName + ":" + meta); @@ -66,7 +67,7 @@ public class NameTranslatorManager { } } - if (id != null && meta != null && !meta.isEmpty()) { + if (id != null && id > 0 && meta != null && !meta.isEmpty()) { mat = CMIMaterial.get(id + ":" + meta); nameLs = ListOfNames.get(mat); if (nameLs == null) {