Map Item Format
| This article is an orphan, as few or no other articles link to it. Please introduce links to this page from related articles You can help us by linking to it or categorizing it.
|
Since Beta 1.6 craftable maps were added. They are placed in the "data" directory within the world's save directory. Each map has its own file associated with its ID and one file that keeps track of the highest (= most recently created) ID. This is limited to the size of a short (65,536).[1] When Notch was adding them the first time he did not use NBT.[2]
The structure tells that there will probably be an additional feature of maps with different zoom and size. There is support for Nether, but it is obscured and therefore unreadable.
Contents |
[edit] Data folder structure
Each map starts with map_, have one unique number and ends with .dat. The file idcounts.dat contains the latest id for current map.
[edit] map_<id>.dat Format
This file has an incremental number in it. The name for the map is in the name of the file, as the name is not in the file.
[edit] NBT Structure
The structure of the file is as follows:
- TAG_Compound("")
- TAG_Compound("data")
- TAG_Byte("scale"): How zoomed in the map is (it is in 2scale blocks square per pixel, even for 0, where the map will be 1:1). Default 3, minimum 0 and maximum 4.
- TAG_Byte("dimension"): 0 = Overworld, -1 = Nether, 1 = The End
- TAG_Short("height"): Height of map. Default (and only possible value) 128
- TAG_Short("width"): Width of map. Default (and only possible value) 128
- TAG_Int("xCenter"): Center of map according to real world by X
- TAG_Int("zCenter"): Center of map according to real world by Z
- TAG_Byte_Array("colors"): Width * Height array of color values (16384 entries for a default 128x128 map). Color can be accessed via the following method: colorID = Colors[widthOffset + heightOffset * width], where (widthOffset==0, heightOffset==0) is left upper point.
- TAG_Compound("data")
When this structure is loaded, Colors array is transformed to standard dimension (if it's necessary) and then structure is saved with standard height and width.
[edit] idcounts.dat Format
This file keeps track of the latest map added. Despite containing NBT tags, it is not an NBT file due lack of GZIP compression.
[edit] NBT Structure
The structure of the file is as follows:
- TAG_Short("map"): Current map id
[edit] Color table
The color IDs are sectioned in groups of 4. Darker color for water is deeper while other blocks is blending with each other.
| ID | Color | RGB | Description |
|---|---|---|---|
| 0 | Transparent | Not explored | |
| 1 | Transparent | Not explored | |
| 2 | Transparent | Not explored | |
| 3 | Transparent | Not explored | |
| 4 | 89,125,39 | Grass | |
| 5 | 109,153,48 | Grass | |
| 6 | 127,178,56 | Grass | |
| 7 | 109,153,48 | Grass | |
| 8 | 174,164,115 | Sand/Gravel | |
| 9 | 213,201,140 | Sand/Gravel | |
| 10 | 247,233,163 | Sand/Gravel | |
| 11 | 213,201,140 | Sand/Gravel | |
| 12 | 117,117,117 | Other | |
| 13 | 144,144,144 | Other | |
| 14 | 167,167,167 | Other | |
| 15 | 144,144,144 | Other | |
| 16 | 180,0,0 | Lava/TNT | |
| 17 | 220,0,0 | Lava/TNT | |
| 18 | 255,0,0 | Lava/TNT | |
| 19 | 220,0,0 | Lava/TNT | |
| 20 | 112,112,180 | Ice | |
| 21 | 138,138,220 | Ice | |
| 22 | 160,160,255 | Ice | |
| 23 | 138,138,220 | Ice | |
| 24 | 117,117,117 | Metal | |
| 25 | 144,144,144 | Metal | |
| 26 | 167,167,167 | Metal | |
| 27 | 144,144,144 | Metal | |
| 28 | 0,87,0 | Plants | |
| 29 | 0,106,0 | Plants | |
| 30 | 0,124,0 | Plants | |
| 31 | 0,106,0 | Plants | |
| 32 | 180,180,180 | Snow | |
| 33 | 220,220,220 | Snow | |
| 34 | 255,255,255 | Snow | |
| 35 | 220,220,220 | Snow | |
| 36 | 115,118,129 | Clay | |
| 37 | 141,144,158 | Clay | |
| 38 | 164,168,184 | Clay | |
| 39 | 141,144,158 | Clay | |
| 40 | 129,74,33 | Dirt | |
| 41 | 157,91,40 | Dirt | |
| 42 | 183,106,47 | Dirt | |
| 43 | 157,91,40 | Dirt | |
| 44 | 79,79,79 | Stone/Cobblestone/Ore | |
| 45 | 96,96,96 | Stone/Cobblestone/Ore | |
| 46 | 112,112,112 | Stone/Cobblestone/Ore | |
| 47 | 96,96,96 | Stone/Cobblestone/Ore | |
| 48 | 45,45,180 | Water | |
| 49 | 55,55,220 | Water | |
| 50 | 64,64,255 | Water | |
| 51 | 55,55,220 | Water | |
| 52 | 73,58,35 | Log/Tree/Wood | |
| 53 | 89,71,43 | Log/Tree/Wood | |
| 54 | 104,83,50 | Log/Tree/Wood | |
| 55 | 89,71,43 | Log/Tree/Wood |
[edit] Material Colors
Blocks are colored according to their Material (in the program code). Each Material has a base color which is multiplied by 180, 220 or 255 to make the map color. Some Materials share the same color; this table shows IDs for the Material Colors (multiply by 4 to get a Map Color ID).