mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-21 18:25:12 +01:00
Merge pull request #2461 from BentoBoxWorld/2459_glow_api_backward_compatibility
Add a try around the new API for glow and fallback to old way #2459
This commit is contained in:
commit
27ba0fe26e
@ -132,7 +132,19 @@ public class PanelItem {
|
||||
return;
|
||||
}
|
||||
if (meta != null) {
|
||||
meta.setEnchantmentGlintOverride(glow);
|
||||
try {
|
||||
meta.setEnchantmentGlintOverride(glow);
|
||||
} catch (NoSuchMethodError 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