Fixed NotSerializableException when logging items containing attribute data

This commit is contained in:
Intelli 2024-12-09 16:37:29 -07:00
parent f729c8a126
commit b3db65d07d
2 changed files with 12 additions and 5 deletions

View file

@ -125,12 +125,12 @@ public class ItemMetaHandler {
if (itemMeta.hasAttributeModifiers()) {
for (Map.Entry<Attribute, AttributeModifier> entry : itemMeta.getAttributeModifiers().entries()) {
Map<Attribute, Map<String, Object>> attributeList = new HashMap<>();
Map<Object, Map<String, Object>> attributeList = new HashMap<>();
Attribute attribute = entry.getKey();
AttributeModifier modifier = entry.getValue();
itemMeta.removeAttributeModifier(attribute, modifier);
attributeList.put(attribute, modifier.serialize());
attributeList.put(BukkitAdapter.ADAPTER.getRegistryKey(attribute), modifier.serialize());
modifiers.add(attributeList);
}
}