Module chunk_storage

Source

Structs§

Chunk
A single chunk in a world (16*?*16 blocks). This only contains the blocks and biomes. You can derive the height of the chunk from the number of sections, but you need a ChunkStorage to get the minimum Y coordinate.
ChunkStorage
A storage for chunks where they’re only stored weakly, so if they’re not actively being used somewhere else they’ll be forgotten. This is used for shared worlds.
PartialChunkStorage
An efficient storage of chunks for a client that has a limited render distance. This has support for using a shared ChunkStorage.
Section
A section of a chunk, i.e. a 161616 block area.

Functions§

calculate_chunk_storage_range
Get the actual stored view distance for the selected view distance. For some reason Minecraft actually stores an extra 3 chunks.
get_block_state_from_sections
Get the block state at the given position from a list of sections. Returns None if the position is out of bounds.
in_range_for_view_center_and_radius
section_index
Get the index of where a section is in a chunk based on its y coordinate and the minimum y coordinate of the world.