From 45bad8032d832da3250c07b22a2cb64e798edc59 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Thu, 9 Nov 2023 07:28:25 +0100 Subject: [PATCH] Fix SkullMeta configuration serialization / deserialization with note block sound By: DerFrZocker --- .../org/bukkit/craftbukkit/inventory/CraftMetaSkull.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java index daf1b12013..3d42bf9e7f 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java @@ -98,10 +98,8 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { if (noteBlockSound == null) { Object object = map.get(NOTE_BLOCK_SOUND.BUKKIT); - if (object instanceof NamespacedKey) { - setNoteBlockSound((NamespacedKey) object); - } else { - setNoteBlockSound(SerializableMeta.getObject(NamespacedKey.class, map, NOTE_BLOCK_SOUND.BUKKIT, true)); + if (object != null) { + setNoteBlockSound(NamespacedKey.fromString(object.toString())); } } } @@ -305,7 +303,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta { } NamespacedKey namespacedKeyNB = this.getNoteBlockSound(); if (namespacedKeyNB != null) { - return builder.put(NOTE_BLOCK_SOUND.BUKKIT, namespacedKeyNB); + return builder.put(NOTE_BLOCK_SOUND.BUKKIT, namespacedKeyNB.toString()); } return builder; }