diff options
author | md_5 <git@md-5.net> | 2018-07-24 10:47:51 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2018-07-24 10:47:51 +1000 |
commit | 7357d7237aab856099e880a525035d049e256021 (patch) | |
tree | 7462bfc187c157dd32f074caa9ea10adde769e7e /src/main/java/org | |
parent | f732acf24fce2e8e292f1c486eb7025cce892b7b (diff) | |
download | craftbukkit-7357d7237aab856099e880a525035d049e256021.tar craftbukkit-7357d7237aab856099e880a525035d049e256021.tar.gz craftbukkit-7357d7237aab856099e880a525035d049e256021.tar.lz craftbukkit-7357d7237aab856099e880a525035d049e256021.tar.xz craftbukkit-7357d7237aab856099e880a525035d049e256021.zip |
SPIGOT-4123: Fix display names cleared by plugins / serialization
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java index ff7ec7e2..c9933be3 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -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 |