mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-19 23:01:29 +01:00
Fix equality of deserialized display names
By: md_5 <git@md-5.net>
This commit is contained in:
parent
d195996997
commit
42b7bb16d3
@ -449,7 +449,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CraftMetaItem(Map<String, Object> map) {
|
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));
|
itemName = CraftChatMessage.fromJSONOrNull(SerializableMeta.getString(map, ITEM_NAME.BUKKIT, true));
|
||||||
|
|
||||||
Iterable<?> lore = SerializableMeta.getObject(Iterable.class, map, LORE.BUKKIT, true);
|
Iterable<?> lore = SerializableMeta.getObject(Iterable.class, map, LORE.BUKKIT, true);
|
||||||
|
@ -221,7 +221,7 @@ public final class CraftChatMessage {
|
|||||||
return fromJSONOrString(message, false, keepNewlines);
|
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 (message == null) message = "";
|
||||||
if (nullable && message.isEmpty()) return null;
|
if (nullable && message.isEmpty()) return null;
|
||||||
IChatBaseComponent component = fromJSONOrNull(message);
|
IChatBaseComponent component = fromJSONOrNull(message);
|
||||||
|
Loading…
Reference in New Issue
Block a user