Commits
Bjarne Koll authored and md_5 committed f0661c3514a
527 527 | for (String key : keys) { |
528 528 | if (!getHandledTags().contains(key)) { |
529 529 | unhandledTags.put(key, internalTag.get(key)); |
530 530 | } |
531 531 | } |
532 532 | } catch (IOException ex) { |
533 533 | Logger.getLogger(CraftMetaItem.class.getName()).log(Level.SEVERE, null, ex); |
534 534 | } |
535 535 | } |
536 536 | |
537 - | Map nbtMap = SerializableMeta.getObject(Map.class, map, BUKKIT_CUSTOM_TAG.BUKKIT, true); |
537 + | Object nbtMap = SerializableMeta.getObject(Object.class, map, BUKKIT_CUSTOM_TAG.BUKKIT, true); // We read both legacy maps and potential modern snbt strings here |
538 538 | if (nbtMap != null) { |
539 539 | this.persistentDataContainer.putAll((NBTTagCompound) CraftNBTTagConfigSerializer.deserialize(nbtMap)); |
540 540 | } |
541 541 | } |
542 542 | |
543 543 | void deserializeInternal(NBTTagCompound tag, Object context) { |
544 544 | // SPIGOT-4576: Need to migrate from internal to proper data |
545 545 | if (tag.contains(ATTRIBUTES.NBT, CraftMagicNumbers.NBT.TAG_LIST)) { |
546 546 | this.attributeModifiers = buildModifiers(tag, ATTRIBUTES); |
547 547 | } |