Skip to main content

Atmosphere

Struct Atmosphere 

Source
pub struct Atmosphere {
    pub id: AtmosphereId,
    pub attributes: BTreeMap<String, Value>,
    pub tint: Option<AtmosphereTint>,
    pub precipitation: Precipitation,
    pub climate: Option<Climate>,
}
Expand description

One declared sky (spec-0080 §3.1): what the party sees and hears while it stands in a cell painted with this atmosphere’s biome.

The biome is vanilla’s one channel for sky colour, fog, clouds, sky-light tint, stars, ambient particles, music, ambience, grass, foliage and water tint, and precipitation. In the overworld the day cycle stacks over it: it multiplies the colours (a biome’s value survives, darkened at night), takes the maximum of star_brightness, and replaces the sun, moon and star angles, the sunrise colour and the moon phase outright — which is why those five ids are refused (DW0928) and the sun cannot be moved from a place.

Fields§

§id: AtmosphereId

atmosphere/<kebab>, unique.

§attributes: BTreeMap<String, Value>

Environment attributes, keyed by id (visual/sky_color; the minecraft: prefix is optional). Which ids a campaign may set, the shape of each value and the range the pinned codec accepts are vendored data (crates/delvec/data/environment-attributes-1.21.11.json), not DSL surface: a value outside them is DW0928. A float attribute may also be written in vanilla’s modifier form, {"argument": 0.85, "modifier": "multiply"}.

§tint: Option<AtmosphereTint>

Grass, foliage, dry-foliage and water tint (#rrggbb), each optional. Absent, vanilla derives grass and foliage from the climate and water is the void biome’s #3f76e4.

§precipitation: Precipitation

What falls here when the world’s weather is rain or thunder. The compiler derives the three vanilla fields that must agree from it (has_precipitation, temperature, downfall), and it is the fact DW0496 reads at a cell: none under a rainy world means the undead burn here.

§climate: Option<Climate>

Overrides the derived temperature / downfall, for vanilla’s own grass colormap at a named point. Must agree with precipitation (DW0930): snow below 0.15, rain at or above it.

Trait Implementations§

Source§

impl Clone for Atmosphere

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Atmosphere

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Atmosphere

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for Atmosphere

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for Atmosphere

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Atmosphere

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Atmosphere

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.