Open JoeDaddyZZZ opened 10 years ago
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...
Can you let me know if https://github.com/LB--/MCModify/commit/2d46601d0870e1ffacbc2f71cb29f6700d955b79 works for you?
I tried the new code with the same result. Do you want me upload my data file?
Sorry forgot the trace;
com.LB_Stuff.NBT.FormatException: Exception while deserializing Compound tag
at com.LB_Stuff.NBT.Tag$Compound.
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.
I have found Mojang code from the anvil converter and it is also having issues with an End Tag.
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.
I take it there's still no solution to this?
Sorry, I haven't had the time to work on this. I'll try and fix it later today.
I ended up using mojang's anvil conversion code as a base to my project.
Sent from Yahoo Mail on Android
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.
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. :\
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