#![forbid(unsafe_code)]
#![warn(missing_docs, unnameable_types)]
mod border;
#[cfg(any(feature = "v26_1", feature = "v26_2", feature = "v26_3"))]
pub mod climate;
mod column;
mod error;
mod helpers;
pub mod packed;
#[cfg(any(feature = "v26_1", feature = "v26_2", feature = "v26_3"))]
pub mod paletted;
mod section;
mod shared;
#[cfg(feature = "v1_12")]
pub mod v1_12;
#[cfg(feature = "v1_16_5")]
pub mod v1_16_5;
#[cfg(feature = "v1_8")]
pub mod v1_8;
#[cfg(feature = "v26_1")]
#[path = "."]
mod modern_775 {
pub(crate) use ghast_data::v26_1 as data;
pub(crate) use ghast_protocol::v26_1 as proto;
pub(crate) const PROTOCOL: u16 = 775;
#[path = "v26_1/mod.rs"]
pub mod world;
}
#[cfg(feature = "v26_1")]
#[doc(inline)]
pub use modern_775::world as v26_1;
#[cfg(feature = "v26_2")]
#[path = "."]
mod modern_776 {
pub(crate) use ghast_data::v26_2 as data;
pub(crate) use ghast_protocol::v26_2 as proto;
pub(crate) const PROTOCOL: u16 = 776;
#[allow(clippy::duplicate_mod)]
#[path = "v26_1/mod.rs"]
pub mod world;
}
#[cfg(feature = "v26_2")]
#[doc(inline)]
pub use modern_776::world as v26_2;
#[cfg(feature = "v26_3")]
#[path = "."]
mod modern_777 {
pub(crate) use ghast_data::v26_3 as data;
pub(crate) use ghast_protocol::v26_3 as proto;
pub(crate) const PROTOCOL: u16 = 777;
#[allow(clippy::duplicate_mod)]
#[path = "v26_1/mod.rs"]
pub mod world;
}
#[cfg(feature = "v26_3")]
#[doc(inline)]
pub use modern_777::world as v26_3;
pub use border::Border;
pub use column::{
Biomes, BlockEntity, ChunkPos, Column, ColumnMap, MAX_Y, MIN_Y, SECTIONS, SectionLight,
};
pub use error::WorldError;
pub use section::{Direct, Indexed, SECTION_VOLUME, Section, block_index};
pub use shared::SharedChunks;
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub struct WorldConfig {
pub biomes: bool,
pub light: bool,
pub block_entities: bool,
}
impl WorldConfig {
#[must_use]
pub const fn with_biomes(mut self, on: bool) -> Self {
self.biomes = on;
self
}
#[must_use]
pub const fn with_light(mut self, on: bool) -> Self {
self.light = on;
self
}
#[must_use]
pub const fn with_block_entities(mut self, on: bool) -> Self {
self.block_entities = on;
self
}
}
impl Default for WorldConfig {
fn default() -> Self {
WorldConfig {
biomes: true,
light: false,
block_entities: false,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub enum Applied {
Changed,
Ignored,
NotWorldPacket,
}