1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-02 14:29:07 +01:00

Avoid NSME exception when ItemMeta#displayName is not added to old Paper yet

This commit is contained in:
montlikadani 2021-03-29 14:07:47 +02:00
parent 3ef805f22f
commit 21305dcc7e

View File

@ -26,7 +26,13 @@ public class Complement2 implements Complement {
@Override
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