Fix equality of deserialized display names

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2024-04-25 07:26:05 +10:00
parent d195996997
commit 42b7bb16d3
2 changed files with 2 additions and 2 deletions

View file

@ -449,7 +449,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
}
CraftMetaItem(Map<String, Object> map) {
displayName = CraftChatMessage.fromJSONOrString(SerializableMeta.getString(map, NAME.BUKKIT, true));
displayName = CraftChatMessage.fromJSONOrString(SerializableMeta.getString(map, NAME.BUKKIT, true), true, false);
itemName = CraftChatMessage.fromJSONOrNull(SerializableMeta.getString(map, ITEM_NAME.BUKKIT, true));
Iterable<?> lore = SerializableMeta.getObject(Iterable.class, map, LORE.BUKKIT, true);

View file

@ -221,7 +221,7 @@ public final class CraftChatMessage {
return fromJSONOrString(message, false, keepNewlines);
}
private static IChatBaseComponent fromJSONOrString(String message, boolean nullable, boolean keepNewlines) {
public static IChatBaseComponent fromJSONOrString(String message, boolean nullable, boolean keepNewlines) {
if (message == null) message = "";
if (nullable && message.isEmpty()) return null;
IChatBaseComponent component = fromJSONOrNull(message);