mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-19 14:51:27 +01:00
SPIGOT-7735: Fix serialization of player heads with note block sound
By: blablubbabc <lukas@wirsindwir.de>
This commit is contained in:
parent
bf2a69e0fc
commit
95f120b7ff
@ -591,7 +591,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
|
||||
String unhandled = SerializableMeta.getString(map, "unhandled", true);
|
||||
if (unhandled != null) {
|
||||
ByteArrayInputStream buf = new ByteArrayInputStream(Base64.getDecoder().decode(internal));
|
||||
ByteArrayInputStream buf = new ByteArrayInputStream(Base64.getDecoder().decode(unhandled));
|
||||
try {
|
||||
NBTTagCompound unhandledTag = NBTCompressedStreamTools.readCompressed(buf, NBTReadLimiter.unlimitedHeap());
|
||||
unhandledTags.copy(DataComponentPatch.CODEC.parse(MinecraftServer.getDefaultRegistryAccess().createSerializationContext(DynamicOpsNBT.INSTANCE), unhandledTag).result().get());
|
||||
@ -1817,6 +1817,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
CraftMetaMap.MAP_ID.TYPE,
|
||||
CraftMetaPotion.POTION_CONTENTS.TYPE,
|
||||
CraftMetaSkull.SKULL_PROFILE.TYPE,
|
||||
CraftMetaSkull.NOTE_BLOCK_SOUND.TYPE,
|
||||
CraftMetaSpawnEgg.ENTITY_TAG.TYPE,
|
||||
CraftMetaBlockState.BLOCK_ENTITY_TAG.TYPE,
|
||||
CraftMetaBook.BOOK_CONTENT.TYPE,
|
||||
|
@ -288,13 +288,16 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
||||
@Override
|
||||
Builder<String, Object> serialize(Builder<String, Object> builder) {
|
||||
super.serialize(builder);
|
||||
|
||||
if (this.profile != null) {
|
||||
return builder.put(SKULL_OWNER.BUKKIT, new CraftPlayerProfile(this.profile));
|
||||
builder.put(SKULL_OWNER.BUKKIT, new CraftPlayerProfile(this.profile));
|
||||
}
|
||||
|
||||
NamespacedKey namespacedKeyNB = this.getNoteBlockSound();
|
||||
if (namespacedKeyNB != null) {
|
||||
return builder.put(NOTE_BLOCK_SOUND.BUKKIT, namespacedKeyNB.toString());
|
||||
builder.put(NOTE_BLOCK_SOUND.BUKKIT, namespacedKeyNB.toString());
|
||||
}
|
||||
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user