Attempting to read an NbtBase List Structure Modifier throws a FieldAccessException for certain NBT Tags.
biglou36 opened this issue ยท 1 comments
Some of the Notchian NbtTags are not supported by ProtocolLib, and therefore throw an exception when attempting to read them. These include light updates, player statistics, recipes, and DataWatchers.
Steps to reproduce the behavior:
- Call the
getListNbtModifier()
method on a relevant packet that contains arrays of Nbt Tags - Attempt to read an unsupported NbtTag by calling the `readSafely()' method or equivalent.
- Experience a FieldAccessException upon run-time.
Provide a method that does not cast the NBT Tags into NBTBase when reading the structure modifier and instead return an Object that the developer may then proceed to manipulate via reflection (does this already exist???). The ideal solution is to simply add support for the new NBT Tags.
I currently do not need these unsupported Nbt Tags, so I simply catch the FieldAccessException and let it fail silently, but I would like to avoid this. Is there a method of removing these unsupported NbtTags from the structure modifier so that I may iterate only through the supported ones?