![]() The top 3 bytes (big endian) are an offset in 4KB 'sectors' and the 4th byte is the size in 4KB sectors. The first is a table of contents, mapping between a ZX coordinate (in Chunk coordinates relative to this file) to a location and size in the file, and the other is a table of timestamps recording when the chunk was last written to disk.Įach table has 1024 4-byte entires, while the timestamps are simple 32-bit numbers, the locations table is split between offset and length. The HeaderĪ Region file starts with a 8192 byte header which is split into two ZX indexed sections. ![]() So now you have a high level overview, lets dig into specifics. To accomodate this without having large empty files, the Region design is almost like a file system of its own.Įverything is aligned to 4096 bytes, there is a header to find a chunk in the file, and chunks can be moved if they are too large for their sector. Region files are named based on the region coordinates such as r.0.0.mca or r.-1.-9.mcaīut as the Minecraft world is generated on demand, not all Chunks will exist in a region. This caused problems with the number of open files and the overhead of opening files was bogging the game down.Īdopted from a mod, Region files were introduced.Ī Region holds 32x32 Chunks, and a Chunk consists of 16x256x16 blocks. In an earlier version of Minecraft, Chunks were stored directly on disk, one file each. Minecraft cuts up a world into Regions and Chunks. We will cover both in more detail throught the post. Since the last post I have learnt how to have the repl start in the right namespace, so you should be in the "devel" namespace, ready to go!įrom here you can look at some already decoded data by inspecting "test-header" and "test-chunk".
0 Comments
Leave a Reply. |