Skip to content
This repository has been archived by the owner on Dec 28, 2020. It is now read-only.

Problem reading 1.7.4 region mca file #3

Open
JoeDaddyZZZ opened this issue Jan 22, 2014 · 12 comments
Open

Problem reading 1.7.4 region mca file #3

JoeDaddyZZZ opened this issue Jan 22, 2014 · 12 comments

Comments

@JoeDaddyZZZ
Copy link

I got your test to work with the given r.0.0.mca file. However, my 1.7.4 data file r.1.-2.mca errored while reading the chuck. Have you tested with this version of minecraft?

com.LB_Stuff.NBT.FormatException: Exception while deserializing Compound tag
at com.LB_Stuff.NBT.Tag$Compound.(Tag.java:1226)
at com.LB_Stuff.NBT.IO.ReadUncompressed(IO.java:66)
at com.LB_Stuff.NBT.Minecraft.Region.ReadChunk(Region.java:185)
at com.jgorski.mc.map.FirstTest.main(FirstTest.java:32)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.LB_Stuff.NBT.Tag$Compound.(Tag.java:1217)
... 3 more
Caused by: com.LB_Stuff.NBT.FormatException: Exception while deserializing Compound tag
at com.LB_Stuff.NBT.Tag$Compound.(Tag.java:1226)
... 8 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.LB_Stuff.NBT.Tag$Compound.(Tag.java:1217)
... 8 more
Caused by: com.LB_Stuff.NBT.FormatException: Found a list of TAG_End
at com.LB_Stuff.NBT.Tag$List.(Tag.java:934)
... 13 more

@LB--
Copy link
Owner

LB-- commented Jan 22, 2014

I have not yet updated the library to work with the latest version of Minecraft, however this particular issue seems to be because at Mojang they decided for whatever reason to represent empty lists as lists of TAG_End. I think I can fix this in-browser...

@LB--
Copy link
Owner

LB-- commented Jan 22, 2014

Can you let me know if 2d46601 works for you?

@JoeDaddyZZZ
Copy link
Author

I tried the new code with the same result. Do you want me upload my data file?

@JoeDaddyZZZ
Copy link
Author

Sorry forgot the trace;

com.LB_Stuff.NBT.FormatException: Exception while deserializing Compound tag
at com.LB_Stuff.NBT.Tag$Compound.(Tag.java:1220)
at com.LB_Stuff.NBT.IO.ReadUncompressed(IO.java:66)
at com.LB_Stuff.NBT.IO.Read(IO.java:52)
at com.jgorski.mc.map.FirstTest.main(FirstTest.java:31)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.LB_Stuff.NBT.Tag$Compound.(Tag.java:1211)
... 3 more
Caused by: com.LB_Stuff.NBT.FormatException: Exception while deserializing Compound tag
at com.LB_Stuff.NBT.Tag$Compound.(Tag.java:1220)
... 8 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.LB_Stuff.NBT.Tag$Compound.(Tag.java:1211)
... 8 more
Caused by: com.LB_Stuff.NBT.FormatException: Exception while deserializing Compound tag
at com.LB_Stuff.NBT.Tag$Compound.(Tag.java:1220)
... 13 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.LB_Stuff.NBT.Tag$Compound.(Tag.java:1211)
... 13 more
Caused by: com.LB_Stuff.NBT.FormatException: java.lang.NoSuchMethodException: com.LB_Stuff.NBT.Tag$End.(java.lang.String, java.io.InputStream)
at com.LB_Stuff.NBT.Tag$List.(Tag.java:946)
... 18 more
Caused by: java.lang.NoSuchMethodException: com.LB_Stuff.NBT.Tag$End.(java.lang.String, java.io.InputStream)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getConstructor(Unknown Source)
at com.LB_Stuff.NBT.Tag$List.(Tag.java:938)
... 18 more

@LB--
Copy link
Owner

LB-- commented Jan 22, 2014

Hm, I don't know why it is trying to actually construct the end tags - the lists should be empty. I don't have time to debug this now (doing college work) - I will be free on friday to work on this.

@JoeDaddyZZZ
Copy link
Author

I have found Mojang code from the anvil converter and it is also having issues with an End Tag.

https://mojang.com/2012/02/new-minecraft-map-format-anvil/

@LB--
Copy link
Owner

LB-- commented Jan 23, 2014

Yeah, that code was released ages ago and it hasn't been updated since. I have no idea why the made the change - their implementation previously forced list of Byte tags if it was empty, even if you specified a specific type. No idea why it worked the way it used or why it works the way it does now, it makes literally no sense.

@codyphobe
Copy link

I take it there's still no solution to this?

@LB--
Copy link
Owner

LB-- commented Jun 22, 2014

Sorry, I haven't had the time to work on this. I'll try and fix it later today.

@JoeDaddyZZZ
Copy link
Author

I ended up using mojang's anvil conversion code as a base to my project.

Sent from Yahoo Mail on Android

@codyphobe
Copy link

I managed to fix it (although I'm sure it's not the best solution) by adding a public constructor to Tag.End that accepts a java String and InputStream, the constructor simply calls this();. However, now I am faced with another problem in NBT.Minecraft.Mob. The Mob class assumes that every mob will have an entry called "AttackTime", but this is not the case for passive mobs such as a Pig. The specific line that calls the FormatException is here.

@LB--
Copy link
Owner

LB-- commented Jun 22, 2014

The Mob class assumes that every mob will have an entry called "AttackTime", but this is not the case for passive mobs such as a Pig.

Darn, Mojang keeps throwing curveballs that didn't exist when I first wrote the library. :\

@LB-- LB-- self-assigned this Aug 29, 2014
@LB-- LB-- added this to the Update for Minecraft 1.8 milestone Aug 29, 2014
@LB-- LB-- added bug labels Aug 29, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants