mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-22 10:45:22 +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;
|
return;
|
||||||
}
|
}
|
||||||
if (meta != null) {
|
if (meta != null) {
|
||||||
|
try {
|
||||||
meta.setEnchantmentGlintOverride(glow);
|
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);
|
icon.setItemMeta(meta);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user