Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Old region files crash #50

Open
Mowstyl opened this issue Aug 4, 2020 · 8 comments
Open

Old region files crash #50

Mowstyl opened this issue Aug 4, 2020 · 8 comments

Comments

@Mowstyl
Copy link

Mowstyl commented Aug 4, 2020

I'm trying to use your library to read some old region files and the next error is being thrown.

java.lang.ClassCastException: Cannot cast net.querz.nbt.tag.LongArrayTag to net.querz.nbt.tag.ListTag
at java.lang.Class.cast(Class.java:3369) ~[?:1.8.0_161]
at net.querz.nbt.tag.CompoundTag.get(CompoundTag.java:74) ~[?:?]
at net.querz.nbt.tag.CompoundTag.getListTag(CompoundTag.java:124) ~[?:?]
at net.querz.mca.Chunk.initReferences(Chunk.java:79) ~[?:?]
at net.querz.mca.Chunk.deserialize(Chunk.java:178) ~[?:?]
at net.querz.mca.MCAFile.deserialize(MCAFile.java:61) ~[?:?]
at net.querz.mca.MCAUtil.read(MCAUtil.java:60) ~[?:?]
at net.querz.mca.MCAUtil.read(MCAUtil.java:26) ~[?:?]

It is caused by Entities being an array of bytes in versions prior 1.10 (as can be seen in https://minecraft.gamepedia.com/Chunk_format).
Fixing this might lead to other errors since other fields were arrays in older versions (TileEntities, TileTicks and LiquidTicks).
Is there any way to read it? My intention is to update those fields to the new format since using forceUpgrade didn't work, so only adding a way to load the chunk with the current data structure would be fine. If that can't be done, just loading everything but those values is fine for me since I don't need them for anything.

@Mowstyl
Copy link
Author

Mowstyl commented Aug 4, 2020

HeightMap might also cause problems.

@Querz
Copy link
Owner

Querz commented Aug 6, 2020

This happens when a world has been updated using forceUpgrade. For some reason Minecraft converts Entities, TileEntities and some other lists into a LongArrayTag when a chunk hasn't been fully generated. I'm working on a fix for that.

This library only supports the "new" block format used in 1.13 and above. From what version do you intend to update your world?

@VideoGameSmash12
Copy link

VideoGameSmash12 commented Dec 25, 2020

Experiencing the same issue, except for some reason it's happening on a more modern version of Minecraft. The world originally started on 1.8 and was gradually updated to 1.15.2.

Exception in thread "main" java.lang.ClassCastException: Cannot cast net.querz.nbt.tag.ByteArrayTag to net.querz.nbt.tag.IntArrayTag
        at java.lang.Class.cast(Unknown Source)
        at net.querz.nbt.tag.CompoundTag.get(CompoundTag.java:74)
        at net.querz.nbt.tag.CompoundTag.getIntArrayTag(CompoundTag.java:116)
        at net.querz.nbt.tag.CompoundTag.getIntArray(CompoundTag.java:177)
        at net.querz.mca.Chunk.initReferences(Chunk.java:70)
        at net.querz.mca.Chunk.deserialize(Chunk.java:178)
        at net.querz.mca.MCAFile.deserialize(MCAFile.java:61)
        at net.querz.mca.MCAUtil.read(MCAUtil.java:60)
        at net.querz.mca.MCAUtil.read(MCAUtil.java:36)

@DerTyan
Copy link

DerTyan commented Jan 18, 2021

I'm also experiencing this issue. My world is also originally from 1.8 and was gradually updated to 1.16.4.

@0xNotAvailable
Copy link

@DerTyan
Have you solved this problem?

@0xNotAvailable
Copy link

Experiencing the same issue, except for some reason it's happening on a more modern version of Minecraft. The world originally started on 1.8 and was gradually updated to 1.15.2.

Exception in thread "main" java.lang.ClassCastException: Cannot cast net.querz.nbt.tag.ByteArrayTag to net.querz.nbt.tag.IntArrayTag
        at java.lang.Class.cast(Unknown Source)
        at net.querz.nbt.tag.CompoundTag.get(CompoundTag.java:74)
        at net.querz.nbt.tag.CompoundTag.getIntArrayTag(CompoundTag.java:116)
        at net.querz.nbt.tag.CompoundTag.getIntArray(CompoundTag.java:177)
        at net.querz.mca.Chunk.initReferences(Chunk.java:70)
        at net.querz.mca.Chunk.deserialize(Chunk.java:178)
        at net.querz.mca.MCAFile.deserialize(MCAFile.java:61)
        at net.querz.mca.MCAUtil.read(MCAUtil.java:60)
        at net.querz.mca.MCAUtil.read(MCAUtil.java:36)

Or u?

@VideoGameSmash12
Copy link

Experiencing the same issue, except for some reason it's happening on a more modern version of Minecraft. The world originally started on 1.8 and was gradually updated to 1.15.2.

Exception in thread "main" java.lang.ClassCastException: Cannot cast net.querz.nbt.tag.ByteArrayTag to net.querz.nbt.tag.IntArrayTag
        at java.lang.Class.cast(Unknown Source)
        at net.querz.nbt.tag.CompoundTag.get(CompoundTag.java:74)
        at net.querz.nbt.tag.CompoundTag.getIntArrayTag(CompoundTag.java:116)
        at net.querz.nbt.tag.CompoundTag.getIntArray(CompoundTag.java:177)
        at net.querz.mca.Chunk.initReferences(Chunk.java:70)
        at net.querz.mca.Chunk.deserialize(Chunk.java:178)
        at net.querz.mca.MCAFile.deserialize(MCAFile.java:61)
        at net.querz.mca.MCAUtil.read(MCAUtil.java:60)
        at net.querz.mca.MCAUtil.read(MCAUtil.java:36)

Or u?

Sorry for the late response, but unfortunately I didn't solve the problem. I ended up saying "frick it", and using a completely different programming language instead.

@GabryOsas
Copy link

Has anyone solved this problem by any chance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants