mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-22 02:35:21 +01:00
Add a try around the new API for glow and fallback to old way #2459
This commit is contained in:
parent
3194195009
commit
d2a6398b4d
@ -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);
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user