From 957669cb7a7205e53919a54743f0442f8db3e77b Mon Sep 17 00:00:00 2001 From: Zrips Date: Mon, 16 Oct 2023 23:35:40 +0300 Subject: [PATCH] When enchant fails, lets skip it --- .../gamingmesh/jobs/config/NameTranslatorManager.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java b/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java index 80b8b77d..2e84095b 100644 --- a/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java @@ -233,7 +233,7 @@ public class NameTranslatorManager { if (listOfNames.size() > 0) CMIMessages.consoleMessage("&eLoaded &6" + listOfNames.size() + " &ecustom item names"); } else - CMIMessages.consoleMessage("&cThe ItemList section not found in &6" + itemFile.fileName + " &cfile."); + CMIMessages.consoleMessage("&cThe ItemList section not found in &6" + itemFile.fileName + " &cfile."); if ((section = itemFile.getConfig().getConfigurationSection("EntityList")) != null) { listOfEntities.clear(); @@ -434,7 +434,13 @@ public class NameTranslatorManager { ConfigurationSection enchSection = c.getC().getConfigurationSection("EnchantList"); for (Enchantment one : Enchantment.values()) { - String enchName = CMIEnchantment.getName(one); + String enchName = "Unknown"; + try { + enchName = CMIEnchantment.getName(one); + } catch (Throwable e) { + // If enchant check failed we can skip this entirely + continue; + } if (enchName.equals("Unknown")) continue;