fix: items deserializing with an empty NBT tag

This commit is contained in:
Matyrobbrt
2024-03-05 16:05:53 +02:00
parent 371132dd19
commit dc277e224a
2 changed files with 2 additions and 1 deletions

View File

@@ -338,7 +338,7 @@ public final class StackUtils {
return AttachmentInternals.reconstructItemStack(
BuiltInRegistries.ITEM.get(new ResourceLocation(tag.getString(NBT_ITEM_ID))),
tag.getInt(NBT_ITEM_QUANTITY),
tag.getCompound(NBT_ITEM_NBT)
tag.contains(NBT_ITEM_NBT) ? tag.getCompound(NBT_ITEM_NBT) : null
);
}
}