1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-25 20:16:13 +01:00

Avoiding enchantments which could produce empty path link

This commit is contained in:
Zrips 2024-06-10 16:47:24 +03:00
parent ad577e60ff
commit d0c36fc246

View File

@ -434,15 +434,18 @@ public class NameTranslatorManager {
ConfigurationSection enchSection = c.getC().getConfigurationSection("EnchantList"); ConfigurationSection enchSection = c.getC().getConfigurationSection("EnchantList");
for (Enchantment one : Enchantment.values()) { for (Enchantment one : Enchantment.values()) {
String enchName = "Unknown"; String enchName = "";
try { try {
enchName = CMIEnchantment.getName(one); enchName = CMIEnchantment.getName(one);
} catch (Throwable e) { } catch (Throwable e) {
// If enchant check failed we can skip this entirely // If enchant check failed we can skip this entirely
continue; continue;
} }
if (enchName.equals("Unknown"))
if (enchName.isEmpty()) {
CMIMessages.consoleMessage("Could not identify enchantment: " + one.toString());
continue; continue;
}
String name = enchName; String name = enchName;