From d0c36fc246dd7601c4bea2019522f8b23308704c Mon Sep 17 00:00:00 2001 From: Zrips Date: Mon, 10 Jun 2024 16:47:24 +0300 Subject: [PATCH] Avoiding enchantments which could produce empty path link --- .../com/gamingmesh/jobs/config/NameTranslatorManager.java | 7 +++++-- 1 file changed, 5 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 19305ed4..1f7c3a03 100644 --- a/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/NameTranslatorManager.java @@ -434,15 +434,18 @@ public class NameTranslatorManager { ConfigurationSection enchSection = c.getC().getConfigurationSection("EnchantList"); for (Enchantment one : Enchantment.values()) { - String enchName = "Unknown"; + String enchName = ""; try { enchName = CMIEnchantment.getName(one); } catch (Throwable e) { // If enchant check failed we can skip this entirely continue; } - if (enchName.equals("Unknown")) + + if (enchName.isEmpty()) { + CMIMessages.consoleMessage("Could not identify enchantment: " + one.toString()); continue; + } String name = enchName;