Add a try around the new API for glow and fallback to old way #2459

This commit is contained in:
tastybento 2024-08-07 21:29:26 -07:00
parent 3194195009
commit d2a6398b4d

View File

@ -132,7 +132,19 @@ public class PanelItem {
return;
}
if (meta != null) {
meta.setEnchantmentGlintOverride(glow);
try {
meta.setEnchantmentGlintOverride(glow);
} catch (Exception e) {
// Try the old way
if (meta != null) {
if (glow) {
meta.addEnchant(Enchantment.LURE, 0, glow);
} else {
meta.removeEnchant(Enchantment.LURE);
}
icon.setItemMeta(meta);
}
}
icon.setItemMeta(meta);
}