Skip to main content

FluidStates

Struct FluidStates 

pub struct FluidStates<'a> { /* private fields */ }
Expand description

The fluid-state facts service, available in setup, reload and world callbacks after keys resolve.

Implementations§

§

impl FluidStates<'_>

pub fn definition(&self, fluid: FluidKey) -> Option<FluidDefinition>

The definition, or none without a resolved registry. Missing prepared world definitions fail resource loading; they are never reported as tank-only.

pub fn type_properties(&self, fluid: FluidKey) -> Option<FluidTypeProperties>

The fluid’s type properties, or none without a resolved registry or for a key it doesn’t hold. Resolve a name with Host::fluid_key, which is none for an unknown one.

pub fn legacy_block(&self, state: FluidState) -> Option<BlockStateId>

FluidState.createLegacyBlock: the block state that holds state in the world, a water or lava block of the matching level, a mod’s world fluid’s block, or air for the empty fluid. None for a state no fluid can be in (a tank-only fluid, an amount above 8, a zero amount for anything but the empty fluid, a source that isn’t full) and without a resolved registry.

pub fn validate( &self, fluid: FluidKey, constraints: &[StateConstraint], ) -> Result<(), FluidStateError>

Validate partial constraints in input order, without matching a particular state. Tank-only or unavailable definitions return NoWorldState; use definition to distinguish them. Indices identify the first offending constraint.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for FluidStates<'a>

§

impl<'a> !Send for FluidStates<'a>

§

impl<'a> !Sync for FluidStates<'a>

§

impl<'a> !UnwindSafe for FluidStates<'a>

§

impl<'a> Freeze for FluidStates<'a>

§

impl<'a> Unpin for FluidStates<'a>

§

impl<'a> UnsafeUnpin for FluidStates<'a>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.