Struct SizedFluidIngredient
pub struct SizedFluidIngredient {
pub ingredient: FluidIngredient,
pub amount: u32,
}Expand description
A FluidIngredient with the amount it asks, as NeoForge’s
SizedFluidIngredient: the fluids the ingredient accepts, and how many
millibuckets of them (a bucket is 1000).
Fields§
§ingredient: FluidIngredientThe fluids it accepts, without an amount.
amount: u32How many millibuckets it asks of one of them; positive.
Implementations§
§impl SizedFluidIngredient
impl SizedFluidIngredient
pub fn from_json(
v: &Value,
context: &dyn DataLoadContext,
) -> Option<SizedFluidIngredient>
pub fn from_json( v: &Value, context: &dyn DataLoadContext, ) -> Option<SizedFluidIngredient>
The sized ingredient of v, from its JSON form:
{"ingredient": <fluid ingredient>, "amount": n} — amount
defaults to a bucket (1000 mB) and must be positive.
pub fn test(&self, stack: &FluidStack) -> bool
pub fn test(&self, stack: &FluidStack) -> bool
SizedFluidIngredient.test: the stack matches the ingredient and
carries at least amount of it.
Trait Implementations§
§impl Clone for SizedFluidIngredient
impl Clone for SizedFluidIngredient
§fn clone(&self) -> SizedFluidIngredient
fn clone(&self) -> SizedFluidIngredient
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 SizedFluidIngredient
impl Debug for SizedFluidIngredient
Auto Trait Implementations§
impl Freeze for SizedFluidIngredient
impl RefUnwindSafe for SizedFluidIngredient
impl Send for SizedFluidIngredient
impl Sync for SizedFluidIngredient
impl Unpin for SizedFluidIngredient
impl UnsafeUnpin for SizedFluidIngredient
impl UnwindSafe for SizedFluidIngredient
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