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

When enchant fails, lets skip it

This commit is contained in:
Zrips 2023-10-16 23:35:40 +03:00
parent e364609ec7
commit 957669cb7a

View File

@ -233,7 +233,7 @@ public class NameTranslatorManager {
if (listOfNames.size() > 0) if (listOfNames.size() > 0)
CMIMessages.consoleMessage("&eLoaded &6" + listOfNames.size() + " &ecustom item names"); CMIMessages.consoleMessage("&eLoaded &6" + listOfNames.size() + " &ecustom item names");
} else } 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) { if ((section = itemFile.getConfig().getConfigurationSection("EntityList")) != null) {
listOfEntities.clear(); listOfEntities.clear();
@ -434,7 +434,13 @@ 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 = 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")) if (enchName.equals("Unknown"))
continue; continue;