diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java index 519b586792..82c24c6cc8 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -519,9 +519,16 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { if (blockData != null) { Map mapBlockData = new HashMap<>(); - NBTTagCompound nbtBlockData = (NBTTagCompound) CraftNBTTagConfigSerializer.deserialize(blockData); - for (String key : nbtBlockData.getAllKeys()) { - mapBlockData.put(key, nbtBlockData.getString(key)); + if (blockData instanceof Map) { + for (Entry entry : ((Map) blockData).entrySet()) { + mapBlockData.put(entry.getKey().toString(), entry.getValue().toString()); + } + } else { + // Legacy pre 1.20.5: + NBTTagCompound nbtBlockData = (NBTTagCompound) CraftNBTTagConfigSerializer.deserialize(blockData); + for (String key : nbtBlockData.getAllKeys()) { + mapBlockData.put(key, nbtBlockData.getString(key)); + } } this.blockData = mapBlockData;