Struct Fluid
pub struct Fluid {
pub key: Identifier,
pub is_empty: bool,
pub is_source: bool,
pub is_randomly_ticking: bool,
pub block: Identifier,
pub bucket_item: Identifier,
pub source_fluid: Option<Identifier>,
pub flowing_fluid: Option<Identifier>,
pub tick_delay: u32,
pub explosion_resistance: f32,
}Expand description
A fluid type definition (e.g., water, lava, empty).
Fields§
§key: IdentifierThe identifier for this fluid (e.g., “minecraft:water”).
is_empty: boolWhether this fluid is empty (air).
is_source: boolWhether this is a source fluid (vs flowing).
is_randomly_ticking: boolWhether this fluid receives random ticks.
block: IdentifierThe block this fluid places.
bucket_item: IdentifierThe bucket item for this fluid.
source_fluid: Option<Identifier>The source fluid identifier (for flowing fluids).
flowing_fluid: Option<Identifier>The flowing fluid identifier (for source fluids).
tick_delay: u32Tick delay for fluid updates.
explosion_resistance: f32Explosion resistance.
Implementations§
§impl Fluid
impl Fluid
pub fn has_tag(&'static self, tag: &Identifier) -> bool
pub fn has_tag(&'static self, tag: &Identifier) -> bool
Returns true if this fluid is tagged with the given tag.
pub fn source_variant(&'static self) -> &'static Fluid
pub fn source_variant(&'static self) -> &'static Fluid
Returns this fluid’s source variant.
Vanilla’s source and flowing fluids are distinct registry entries. Liquid blocks store a single block id plus a level property, so state decoding resolves the correct fluid variant from extracted fluid relationship data.
pub fn flowing_variant(&'static self) -> &'static Fluid
pub fn flowing_variant(&'static self) -> &'static Fluid
Returns this fluid’s flowing variant.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Fluid
impl RefUnwindSafe for Fluid
impl Send for Fluid
impl Sync for Fluid
impl Unpin for Fluid
impl UnsafeUnpin for Fluid
impl UnwindSafe for Fluid
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
self with key and returns true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreArc<SyncMutex<>>