Querz / NBT

A java implementation of the NBT protocol, including a way to implement custom tags.
MIT License
182 stars 48 forks source link

Cannot cast net.querz.nbt.ByteArrayTag to net.querz.nbt.IntArrayTag #38

Closed antonilol closed 4 years ago

antonilol commented 5 years ago

When i executed this: MCAFile mcaFile = MCAUtil.readMCAFile("r.0.0.mca"); this error occurs: java.lang.ClassCastException: Cannot cast net.querz.nbt.ByteArrayTag to net.querz.nbt.IntArrayTag

The file r.0.0.mca exists

Anyone help me

Tacodiva commented 4 years ago

Also getting this issue.

amooose commented 4 years ago

This is due to Chunk.java line 65. Simply comment out this.biomes = level.getIntArray("Biomes"); It'll work, at the expense of not having biome information, I haven't looked into it further.

Querz commented 4 years ago

This is due to Minecraft 1.13+ using an IntArrayTag to store biome ids, while older versions still use a ByteArrayTag.

Querz commented 4 years ago

The MCA library does currently not support Minecraft versions below 1.13. It is unlikely, that I will make it backwards compatible. Maybe someone else wants to do that and create a pull request.