Unable to read files from Minecraft 1.21.5
CompoundTag rootTag = NbtFile.Read(path, FormatOptions.Java);
The above works fine up to and including Minecraft 1.21.4, but from Minecraft 1.21.5 it throws an exception...
System.FormatException
HResult=0x80131537
Message=Children of this collection type must be named.
Source=SharpNBT
StackTrace:
at SharpNBT.CompoundTag.ValidateChild(Tag tag)
at SharpNBT.CompoundTag.Add(Tag value)
at SharpNBT.TagReader.ReadCompound(Boolean named)
at SharpNBT.TagReader.ReadTag(TagType type, Boolean named)
at SharpNBT.TagReader.ReadList(Boolean named)
at SharpNBT.TagReader.ReadTag(TagType type, Boolean named)
at SharpNBT.TagReader.ReadCompound(Boolean named)
at SharpNBT.TagReader.ReadTag(TagType type, Boolean named)
at SharpNBT.TagReader.ReadList(Boolean named)
at SharpNBT.TagReader.ReadTag(TagType type, Boolean named)
at SharpNBT.TagReader.ReadCompound(Boolean named)
at SharpNBT.TagReader.ReadTag(TagType type, Boolean named)
at SharpNBT.TagReader.ReadCompound(Boolean named)
at SharpNBT.TagReader.ReadTag(TagType type, Boolean named)
at SharpNBT.TagReader.ReadCompound(Boolean named)
at SharpNBT.TagReader.ReadTag(TagType type, Boolean named)
at SharpNBT.TagReader.ReadCompound(Boolean named)
at SharpNBT.TagReader.ReadTag(TagType type, Boolean named)
at SharpNBT.TagReader.ReadCompound(Boolean named)
at SharpNBT.TagReader.ReadTag(TagType type, Boolean named)
at SharpNBT.TagReader.ReadTag(Boolean named)
at SharpNBT.TagReader.ReadTag[T](Boolean named)
at SharpNBT.NbtFile.Read(String path, FormatOptions options, CompressionType compression)
at StorageNBTReader.ActiveItems.Get(String path) in F:\gitworkdir\PlayMinecraftBingo\libFetchr\src\StorageNBTReader\ActiveItems.cs:line 13
at StorageNBTReader.Program.Main() in F:\gitworkdir\PlayMinecraftBingo\libFetchr\src\StorageNBTReader\Program.cs:line 16