Crate fastanvil

source ·
Expand description

For handling Minecraft’s region format, Anvil. This crate is mostly to support creating maps of Minecraft worlds and is not stable (per-1.0). The Region struct is probably the most generally useful part in this crate.

This crate also contains a JavaChunk that allows deserializing 1.18 down to about 1.15 chunks into some structs. This doesn’t record all information from a chunk however, eg entities are lost. It is not suitable for serializing back into a region.

You can create your own chunk structures to (de)serialize using fastnbt.

Region can be given a Read, Write and Seek type eg a file in order to read and write chunk data.

§Crate features

  • render - This feature is enabled by default and encapsulates all world-rendering related functionality.

Modules§

Structs§

  • A Minecraft chunk.
  • Various heightmaps kept up to date by Minecraft.
  • PackedBits can be used in place of blockstates in chunks to avoid allocating memory for them when they might not be needed. This object by default just retains a reference to the data in the input, and unpack_into can be used to get the unpacked version when needed.
  • A Minecraft Region, allowing reading and writing of chunk data to a stream (eg a File). This does not concern itself with manipulating chunk data, users are expected to use fastnbt or other deserialization method to manipulate the chunk data itself.
  • A vertical section of a chunk (ie a 16x16x16 block cube)
  • SectionTower represents the set of sections that make up a Minecraft chunk. It has a custom deserialization in order to more efficiently lay out the sections for quick access.
  • Iterator over block state data. Each value is the index into the relevant palette.

Enums§

Statics§

Traits§

  • Palette can be used to take a block description to produce a colour that it should render to.
  • RegionLoader implmentations provide access to regions. They do not need to be concerned with caching, just providing an object that implements Region.

Functions§

Type Aliases§