mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-06 16:27:59 +01:00
Avoid NSME exception when ItemMeta#displayName is not added to old Paper yet
This commit is contained in:
parent
3ef805f22f
commit
21305dcc7e
@ -26,7 +26,13 @@ public class Complement2 implements Complement {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDisplayName(ItemMeta meta) {
|
public String getDisplayName(ItemMeta meta) {
|
||||||
return meta.displayName() == null ? null : serialize(meta.displayName());
|
Component dName = null;
|
||||||
|
try {
|
||||||
|
dName = meta.displayName();
|
||||||
|
} catch (NoSuchMethodError e) {
|
||||||
|
}
|
||||||
|
|
||||||
|
return dName == null ? null : serialize(dName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user