1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-28 12:00:23 +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");
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;