Skip to main content

silverfish/
lib.rs

1#![doc = include_str!("../readme.md")]
2#![feature(str_as_str)]
3#![feature(try_find)]
4#![warn(missing_docs)]
5
6mod biome;
7mod chunk;
8mod config;
9mod coords;
10mod data;
11mod error;
12mod get;
13mod nbt;
14mod nbt_impls;
15mod paletted_blocks;
16mod region;
17mod set;
18mod write;
19
20pub use biome::{BiomeCell, BiomeCellWithId, coordinates_to_biome_cell};
21pub use chunk::ChunkData;
22pub use config::Config;
23pub use coords::Coords;
24pub use error::{Error, Result};
25pub use nbt::{Block, Name, NbtString};
26pub use paletted_blocks::{PalettedBlocks, PalettedBlocksIntoIter};
27pub use region::{BlockWithCoordinate, Region, get_empty_chunk, to_region_local};
28
29/// How many blocks wide a region is.  
30pub const BLOCKS_PER_REGION: u32 = (ChunkData::WIDTH * mca::REGION_SIZE) as u32;
31/// Used in a lot of places for `(num & 15)` since 15 is 1 less than 16 (chunk width).  
32pub(crate) const CHUNK_OP: i32 = (ChunkData::WIDTH - 1) as i32;
33
34// re-export `RefMut` under "dashmap"
35// since it's really the only type from dashmap the user may want
36// that is tied to a function ("get_mut_chunk").
37/// Types re-exported from the crate `dashmap`
38pub mod dashmap {
39    pub use dashmap::mapref::one::RefMut;
40}
41
42// 4562