SPIGOT-4123: Fix display names cleared by plugins / serialization

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2018-07-24 10:47:51 +10:00
parent 6ecf05152e
commit 9ca157b2b6

View file

@ -566,7 +566,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
}
public final void setDisplayName(String name) {
this.displayName = new ChatComponentText(name);
this.displayName = (name == null) ? null : new ChatComponentText(name);
}
public boolean hasDisplayName() {
@ -580,7 +580,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
@Override
public void setLocalizedName(String name) {
this.locName = new ChatComponentText(name);
this.locName = (name == null) ? null : new ChatComponentText(name);
}
@Override