Minecraft:Anvil file format: Difference between revisions
More actions
Sync: updated from Minecraft |
Sync: updated from Minecraft |
||
| Line 4: | Line 4: | ||
== Changes from MCRegion == | == Changes from MCRegion == | ||
[[File:Anvil Conversion.png|200px|thumb|right|Converting a world from [[MCRegion]] format to Anvil.]] | [[File:Anvil Conversion.png|200px|thumb|right|Converting a world from [[MCRegion]] format to Anvil in [[Minecraft:Java Edition 1.2.1|1.2.1]]]] | ||
[[File:Anvil Conversion 1.3.1.png|200px|thumb|right|Converting a world from MCRegion format to Anvil in [[Java Edition 1.3.1|1.3.1]]]] | |||
The only changes from MCRegion to Anvil were in the [[Minecraft:Chunk format]]; the [[Minecraft:Region file format]] is still used, but labeled as Anvil. The Anvil format introduced these changes to the Chunk format: | The only changes from MCRegion to Anvil were in the [[Minecraft:Chunk format]]; the [[Minecraft:Region file format]] is still used, but labeled as Anvil. The Anvil format introduced these changes to the Chunk format: | ||
* Maximum build height has been increased to 256 (from 128). | * Maximum build height has been increased to 256 (from 128). | ||
* Empty sections of the world are not loaded into memory or saved to disk. | * Empty sections of the world are not loaded into memory or saved to disk. | ||
* The maximum | * The maximum block ID has been increased to 4096 (was 256) by adding a 4-bit data layer (similar to how metadata is stored). The rest of the game's code was not prepared to take advantage of this, however mods made use of this. | ||
* Block ordering has been changed from XZY to YZX in order to improve compression. | * Block ordering has been changed from XZY to YZX in order to improve compression. | ||
* Packets for sending [[Minecraft:chunks]] have been optimized (a chunk without [[Minecraft:air]] is smaller than in the same chunk in the old format, and a chunk with lots of air is even smaller). | * Packets for sending [[Minecraft:chunks]] have been optimized (a chunk without [[Minecraft:air]] is smaller than in the same chunk in the old format, and a chunk with lots of air is even smaller). | ||
| Line 28: | Line 29: | ||
== World size reduction post-conversion == | == World size reduction post-conversion == | ||
{{Script warning}} | {{Script warning|section=1}} | ||
Anvil world data uses a <code>.mca</code> file extension, while McRegion uses <code>.mcr</code>. The game leaves the old McRegion files after converting a world to Anvil, despite the game never using them again. To reduce the file size of backups, the old McRegion files may be deleted. To do this, perform the following steps: | Anvil world data uses a <code>.mca</code> file extension, while McRegion uses <code>.mcr</code>. The game leaves the old McRegion files after converting a world to Anvil, despite the game never using them again. To reduce the file size of backups, the old McRegion files may be deleted. To do this, perform the following steps: | ||
* Windows: | * Windows: | ||
*# Open | *# Open a Command Prompt window by pressing {{key|Win+R}}, typing <code>cmd</code> and pressing {{key|Enter}}. | ||
*# Run the following | *# Run the following commands: <syntaxhighlight lang="dosbatch"> | ||
rem Navigate to the world directory (usually "%appdata%\.minecraft\saves\[world name]") | |||
rem See the [[Minecraft:.minecraft]] article for more information. | |||
cd "[path to world directory]" | |||
rem Delete McRegion files for the Overworld | |||
del region\*.mcr | |||
rem Delete McRegion files for the Nether | |||
del DIM-1\region\*.mcr | |||
rem Delete McRegion files for the End | |||
del DIM1\region\*.mcr | |||
</syntaxhighlight> | |||
*# Close the Command Prompt window. | |||
* Linux and macOS: | * Linux and macOS: | ||
*# Open the terminal | *# Open the terminal (usually with {{key|Ctrl+Alt+T}} on Linux) | ||
*# Run the following | *# Run the following commands: <syntaxhighlight lang="bash"> | ||
# Navigate to the world directory -- see the [[Minecraft:.minecraft]] article for more information. | |||
cd "[path to world directory]" | |||
# Delete McRegion files for the Overworld | |||
rm region/*.mcr | |||
# Delete McRegion files for the Nether | |||
rm DIM-1/region/*.mcr | |||
# Delete McRegion files for the End | |||
rm DIM1/region/*.mcr | |||
</syntaxhighlight> | |||
*# Close the terminal. | |||
== History == | == History == | ||
Revision as of 11:04, 30 July 2026
Template:For Template:Exclusive Anvil<ref name="Anvil">https://web.archive.org/web/20120302221152/https://www.mojang.com/2012/02/new-minecraft-map-format-anvil/</ref> is a file storage format. It brings a list of changes and improvements over from the previous file format, Region. It was implemented in snapshot Minecraft:12w07a for release in Minecraft:Java Edition 1.2.1. level.dat Template:Nbt is 19133.
Changes from MCRegion
The only changes from MCRegion to Anvil were in the Minecraft:Chunk format; the Minecraft:Region file format is still used, but labeled as Anvil. The Anvil format introduced these changes to the Chunk format:
- Maximum build height has been increased to 256 (from 128).
- Empty sections of the world are not loaded into memory or saved to disk.
- The maximum block ID has been increased to 4096 (was 256) by adding a 4-bit data layer (similar to how metadata is stored). The rest of the game's code was not prepared to take advantage of this, however mods made use of this.
- Block ordering has been changed from XZY to YZX in order to improve compression.
- Packets for sending Minecraft:chunks have been optimized (a chunk without Minecraft:air is smaller than in the same chunk in the old format, and a chunk with lots of air is even smaller).
- Minecraft:Biomes are saved per X,Z column, rather than being calculated on the fly, which means they can be altered by tools; this is useful for map makers. It also prevents issues where features within previously generated chunks don't match the biome after the way biomes generate change, usually due to updates or mods. (Also known as "Biome shifting")
Further information
Versions from 12w07a to 1.17.1 automatically convert worlds to the new format, but a copy of the world files is created in the previous formats for compatibility with older game versions. Previously generated chunks have not been changed, so there is an additional 128 blocks of air above existing terrain, making 192 blocks from sea level to the height limit.
- The 16×128×16 "Blocks", "Data", "SkyLight" and "BlockLight" tags were moved and repurposed. (see below)
- A "Sections" List tag containing Compound tags has been added with up to 16 Compound tags.
- Each section has 16×16×16 "Blocks", "Data", "SkyLight" and "BlockLight" tags.
- Each section has a "Y" Byte tag saying which section it is (note that some Y positions can be skipped). 0 is at the bottom of the world and 15 is the topmost section.
- Each section also has an optional "Add" tag, which is a DataLayer byte array just like "Data". The "Add" tag is not included in the converter since the old format never had block ids above 255. This extra tag is created whenever a block requires it, so the Template:Code method needs to check if the array exists and then combine it with the default block data. In other words, Template:Code.
- Each chunk has a 16×16 byte array with biome IDs called "Biomes". If this array is missing it is filled when the game starts, as well any -1 values in the array. The converter source provided for developers doesn't include any biome sources, however.
- Note that the old format is XZY (Template:Code) and the new format is YZX (Template:Code) (see the difference between DataLayer and OldDataLayer).
- The new format uses the extension ".mca" instead of ".mcr" (the old format is kept for safety, with the level.dat backed up as "level.dat_mcr").
- A new NBT tag type called IntArray was added to the Minecraft:NBT Format (With ID 11) and is used by the "Heightmap" tag.
Additional information may be found on the Minecraft:Chunk format page.
World size reduction post-conversion
Anvil world data uses a .mca file extension, while McRegion uses .mcr. The game leaves the old McRegion files after converting a world to Anvil, despite the game never using them again. To reduce the file size of backups, the old McRegion files may be deleted. To do this, perform the following steps:
- Windows:
- Open a Command Prompt window by pressing Template:Key, typing
cmdand pressing Template:Key. - Run the following commands: <syntaxhighlight lang="dosbatch">
- Open a Command Prompt window by pressing Template:Key, typing
rem Navigate to the world directory (usually "%appdata%\.minecraft\saves\[world name]") rem See the Minecraft:.minecraft article for more information. cd "[path to world directory]"
rem Delete McRegion files for the Overworld del region\*.mcr
rem Delete McRegion files for the Nether del DIM-1\region\*.mcr
rem Delete McRegion files for the End del DIM1\region\*.mcr </syntaxhighlight>
- Close the Command Prompt window.
- Linux and macOS:
- Open the terminal (usually with Template:Key on Linux)
- Run the following commands: <syntaxhighlight lang="bash">
- Navigate to the world directory -- see the Minecraft:.minecraft article for more information.
cd "[path to world directory]"
- Delete McRegion files for the Overworld
rm region/*.mcr
- Delete McRegion files for the Nether
rm DIM-1/region/*.mcr
- Delete McRegion files for the End
rm DIM1/region/*.mcr </syntaxhighlight>
- Close the terminal.
History
See also
References
Template:Navbox Java Edition technical
Minecraft:de:Spielstand-Speicherung/Anvil Format Minecraft:es:Formato de archivo Anvil Minecraft:fr:Format de fichier Anvil Minecraft:ja:Anvilファイルフォーマット Minecraft:nl:Anvil bestandsformaat Minecraft:pt:Anvil (formato de arquivo) Minecraft:ru:Anvil (формат карт) Minecraft:zh:Anvil文件格式