Class SizedFluidIngredient
java.lang.Object
net.neoforged.neoforge.fluids.crafting.SizedFluidIngredient
Standard implementation for a FluidIngredient with an amount.
FluidIngredient, like its item counterpart, explicitly does not perform count checks,
so this class is used to (a) wrap a standard FluidIngredient with an amount and (b) provide a
standard serialization format for mods to use.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intstatic final com.mojang.serialization.Codec<SizedFluidIngredient> The codec forSizedFluidIngredient.private final FluidIngredientstatic final StreamCodec<RegistryFriendlyByteBuf, SizedFluidIngredient> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintamount()booleaninthashCode()static SizedFluidIngredientbooleantest(FluidStack stack) Performs a size-sensitive test on the given stack.toString()
-
Field Details
-
CODEC
The codec forSizedFluidIngredient.With this codec, the amount is serialized separately from the ingredient itself, for example:
{ "ingredient": "minecraft:lava", "amount": 1000 }or for custom ingredients:
{ "ingredient": { "neoforge:type": "neoforge:intersection", "children": [ "#example:tag1", "#example:tag2" ], }, "amount": 4711 } -
STREAM_CODEC
-
ingredient
-
amount
private final int amount
-
-
Constructor Details
-
SizedFluidIngredient
-
-
Method Details
-
of
-
ingredient
-
amount
public int amount() -
test
Performs a size-sensitive test on the given stack.- Returns:
trueif the stack matches the ingredient and has at least the required amount.
-
equals
-
hashCode
public int hashCode() -
toString
-