Struct FluidIngredient
pub struct FluidIngredient { /* private fields */ }Expand description
A set of accepted fluids, as NeoForge’s FluidIngredient: a fluid
(minecraft:water), a #tag, a list of them, or the three shapes with
their children, parsed from a recipe’s JSON by the same walk an item
Ingredient parses its own with, over the fluid
tags the load’s DataLoadContext holds. A kind outside the standard
shapes fails the parse: fluids have no custom ingredient hook.
Components are not checked — any stack of a named fluid answers.
Implementations§
§impl FluidIngredient
impl FluidIngredient
pub fn from_json(
v: &Value,
context: &dyn DataLoadContext,
) -> Result<FluidIngredient, FluidIngredientError>
pub fn from_json( v: &Value, context: &dyn DataLoadContext, ) -> Result<FluidIngredient, FluidIngredientError>
Parse a fluid, tag, list or standard shape against this load’s fluid registry. Invalid shapes or unknown names return a typed error.
pub fn test(&self, stack: &FluidStack) -> bool
pub fn test(&self, stack: &FluidStack) -> bool
FluidIngredient.test: the stack’s fluid among the ones the source
named — and for a shape, each child its own way (any for
compound, all for intersection, base-but-not-subtracted for
difference).
Trait Implementations§
§impl Clone for FluidIngredient
impl Clone for FluidIngredient
§fn clone(&self) -> FluidIngredient
fn clone(&self) -> FluidIngredient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more