Struct FluidStack
pub struct FluidStack {
pub fluid: FluidIdentity,
pub amount: u32,
pub components: Option<Box<Components>>,
}Expand description
An amount of one fluid, as NeoForge’s FluidStack: its registered or unresolved
FluidIdentity, millibuckets, and data components, kept as an item stack’s are (a potion fluid’s
minecraft:potion_contents). Water and lava have none.
Fields§
§fluid: FluidIdentityThe fluid.
amount: u32The amount.
components: Option<Box<Components>>The components.
Implementations§
§impl FluidStack
impl FluidStack
pub fn new(fluid: FluidKey, amount: u32) -> FluidStack
pub fn new(fluid: FluidKey, amount: u32) -> FluidStack
amount of fluid, with no components.
pub fn with_amount(&self, amount: u32) -> FluidStack
pub fn with_amount(&self, amount: u32) -> FluidStack
The same fluid with the same components, amount of it.
pub fn has_components(&self) -> bool
pub fn has_components(&self) -> bool
Whether it carries any component.
pub fn same_fluid_same_components(&self, other: &FluidStack) -> bool
pub fn same_fluid_same_components(&self, other: &FluidStack) -> bool
NeoForge’s FluidStack.isSameFluidSameComponents: the same id and the same components,
an empty patch counting as none. Fills, merges and capacities ask it.
Trait Implementations§
§impl Clone for FluidStack
impl Clone for FluidStack
§fn clone(&self) -> FluidStack
fn clone(&self) -> FluidStack
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for FluidStack
impl Debug for FluidStack
§impl PartialEq for FluidStack
impl PartialEq for FluidStack
impl StructuralPartialEq for FluidStack
Auto Trait Implementations§
impl Freeze for FluidStack
impl RefUnwindSafe for FluidStack
impl Send for FluidStack
impl Sync for FluidStack
impl Unpin for FluidStack
impl UnsafeUnpin for FluidStack
impl UnwindSafe for FluidStack
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
Mutably borrows from an owned value. Read more