From 7357d7237aab856099e880a525035d049e256021 Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 24 Jul 2018 10:47:51 +1000 Subject: [PATCH] SPIGOT-4123: Fix display names cleared by plugins / serialization --- .../java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java | 4 ++-- 1 file 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 ff7ec7e2ba..c9933be3bc 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