MHDR: flags=0MHDR: OffsetInfo=0MHDR: OffsetTex=0MHDR: OffsetModel=0MHDR: OffsetModelId=0MHDR: OffsetMapObj=0MHDR: OffsetMapObjId=0MHDR: OffsetDoodadDef=4251MHDR: OffsetObjDef=4243MHDR: pad1=4235MHDR: pad2=4227MHDR: unk1=4219MHDR: unk2=4211MHDR: unk3=4168MHDR: unk4=64MHDR: unk5=-1097516758MCIN: entry0={flags=1740, aSyncId=450019, MCNK_Offset=0, size=0}MCIN: entry1={flags=1740, aSyncId=448271, MCNK_Offset=0, size=0}...MCIN: entry251={flags=1740, aSyncId=11271, MCNK_Offset=0, size=0}MCIN: entry252={flags=1740, aSyncId=9523, MCNK_Offset=0, size=0}MCIN: entry253={flags=1740, aSyncId=7775, MCNK_Offset=0, size=0}MCIN: entry254={flags=1740, aSyncId=6027, MCNK_Offset=0, size=0}MCIN: entry255={flags=1740, aSyncId=4279, MCNK_Offset=0, size=0}MTEX: texture_path_34=MCNK: flags=0MCNK: indexX=1296257861MCNK: indexY=0MCNK: nLayers=1296253260MCNK: nDoodadRefs=0MCNK: ofsHeightMap=0
You're having a pointer off. Your nLayers is the beginning of a zero-size MCAL. Seems like you're taking the wrong offset to start at.Also: the wiki is on WotLK files!
MHDR: unused4=0MHDR: unused3=0MHDR: unused2=0MHDR: unused1=0MHDR: offsetMTFX=0MHDR: offsetMH2O=0MHDR: offsetMFBO=0MHDR: offsetMODF=4251MHDR: offsetMDDF=4243MHDR: offsetMWID=4235MHDR: offsetMWMO=4227MHDR: offsetMMID=4219MHDR: offsetMMDX=4211MHDR: offsetMTEX=4168MHDR: offsetMCIN=64MHDR: flags=-1097516758
Add 0x14 to all offsets.You may always want to start reading a chunk by comparing the identifier. At 0x0 in the file you should get 'MVER'.This is not the case with your reading. It is not the file being wrong, but as said, you reading starting at the wrong position.
Read MVER // now we've read the MVER from the file, the FileInputStream increments it's position, so the next chunk will be MHDR Read MHDR Read MCIN Read MCNK // This is where I am having trouble.
read 4 bytes -> name read 4 bytes -> size create array[size]