ljyloo / LevelDb2Avnil

Convert Minecraft: Pocket Edition(LevelDb) map to Minecraft(Avnil) map
GNU General Public License v2.0
101 stars 31 forks source link

Unable to run at minecraftpe1.5? (even if there are no new squares on the map) #51

Open ZanyXD opened 6 years ago

ZanyXD commented 6 years ago

D:>java -jar Converter.jar D:/MC/AA D:/mcpc Converting chunk 0,0... Biomes and Heightmap SubChunk...0 Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException at java.base/java.lang.System.arraycopy(Native Method) at com.ljyloo.PE2PC.ConvertSource.convertSubChunk(ConvertSource.java:127) at com.ljyloo.PE2PC.PE2PC.convert(PE2PC.java:102) at com.ljyloo.PE2PC.PE2PC.main(PE2PC.java:35)

CrystalRays commented 6 years ago

I hava the same problem. How to fix it ?

CrystalRays commented 6 years ago

I am new to Java. I found the leveldb fields read into the program are divided to two part: byte[4096] oldBlock & byte[2048] oldMeta. I guess the leveldb fields of old Minecraft Bedrock are byte[6145]:1+4096+2048 But now there is some fields are byte[2509], byte[23**] and etc. So here comes the error: ArrayIndexOutOfBoundsException, when use the arraycopy to copy and divide the fields to oldBlock and old Meta. I don't know how to fix it, is here anyone can fix it?

nomizzz commented 6 years ago

@CrystalRays nice insight, from my limited debugging and experience with the NBT format, it I think you're on the right track.

Looks like in one of the Bedrock upgrades the "Block Data" field of Subchunks can now be variable and less than the BLOCKDATA_BYTES constant defined on line 18 of ConvertSource.java. I'm trying to debug it further but because there's such limited data on the Bedrock Level format I'm having trouble determining what belongs there.

This also seems to be a duplicate of https://github.com/ljyloo/LevelDb2Avnil/issues/46

CrystalRays commented 6 years ago

Thanks. @nomizzz Thanks for your effort. If possible we should to search for more information about what has mojang changed in the new version of Bloack Data which is really difficulty. It's the first time I tried to read Java code, however I had a little experience on other language and I will try to continue on this issue.

Maybe my pour English would bother you and sorry for that if it's true.

0x9fff00 commented 6 years ago

@CrystalRays @nomizzz See my comment in #46 for documentation.