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§

biome
functionality relating to Minecraft biomes.
complete
pre13
1.2 to 1.12
pre18
1.13 to 1.17
tex

Structs§

BiomeData
Block
BlockData
CCoord
ChunkData
ChunkLocation
CurrentJavaChunk
A Minecraft chunk.
Heightmaps
Various heightmaps kept up to date by Minecraft.
LoaderError
PackedBits
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.
PaletteError
RCoord
Region
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.
RegionFileLoader
RegionIter
RegionMap
RenderedPalette
Section
A vertical section of a chunk (ie a 16x16x16 block cube)
SectionTower
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.
StatesIter
Iterator over block state data. Each value is the index into the relevant palette.
TopShadeRenderer

Enums§

BlockArchetype
CompressionScheme
Various compression schemes that NBT data is typically compressed with.
Error
HeightMode
JavaChunk
A Minecraft chunk.

Statics§

AIR
SNOW_BLOCK

Traits§

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

Functions§

bits_per_block
Get the number of bits that will be used in Blockstates per block.
expand_blockstates
Expand blockstate data so each block is an element of a Vec.
expand_generic_1_15
Expand generic bit-packed data in the 1.15 format, ie data potentially existing across two 64-bit ints.
expand_generic_1_16
Expand generic bit-packed data in the 1.16 format, ie with padding bits.
expand_heightmap
Expand heightmap data. This is equivalent to expand_generic(data, 9).
load_rendered_palette
Load a prepared rendered palette. This is for use with the palette.tar.gz alongside the fastnbt project repository.
render_region
unstable_div_ceil

Type Aliases§

LoaderResult
Result
Rgba