public class FluidIngredient
extends net.minecraft.item.crafting.Ingredient
| Modifier and Type | Class and Description |
|---|---|
static class |
FluidIngredient.Serializer |
| Modifier and Type | Field and Description |
|---|---|
static FluidIngredient |
EMPTY |
| Modifier | Constructor and Description |
|---|---|
protected |
FluidIngredient(java.util.List<net.minecraft.fluid.Fluid> fluids,
int amount,
net.minecraft.util.ResourceLocation fluidId,
net.minecraft.tags.ITag<net.minecraft.fluid.Fluid> fluidTag,
net.minecraft.nbt.CompoundNBT nbt,
boolean fuzzyNBT) |
| Modifier and Type | Method and Description |
|---|---|
int |
getAmount() |
protected java.util.Collection<net.minecraft.fluid.Fluid> |
getFluidList() |
java.util.List<net.minecraftforge.fluids.FluidStack> |
getFluidStacks() |
net.minecraft.item.ItemStack[] |
getItems() |
net.minecraftforge.common.crafting.IIngredientSerializer<? extends net.minecraft.item.crafting.Ingredient> |
getSerializer() |
boolean |
isEmpty() |
static FluidIngredient |
of(net.minecraftforge.fluids.FluidStack fluidStack)
Create a fluid ingredient from the given FluidStack.
|
static FluidIngredient |
of(int amount,
net.minecraft.nbt.CompoundNBT nbt,
boolean fuzzyNBT,
net.minecraft.fluid.Fluid... fluids)
Create a fluid ingredient from the given list of fluids
|
static FluidIngredient |
of(int amount,
net.minecraft.nbt.CompoundNBT nbt,
boolean fuzzyNBT,
net.minecraft.tags.ITag<net.minecraft.fluid.Fluid> fluidTag)
Create a fluid ingredient from the given fluid tag
|
static FluidIngredient |
of(int amount,
net.minecraft.nbt.CompoundNBT nbt,
boolean fuzzyNBT,
net.minecraft.util.ResourceLocation fluidId)
Create a fluid ingredient from the given fluid registry ID.
|
static FluidIngredient |
of(int amount,
net.minecraft.fluid.Fluid... fluids)
Create a fluid ingredient from the given list of fluids
|
static FluidIngredient |
of(int amount,
net.minecraft.tags.ITag<net.minecraft.fluid.Fluid> fluidTag)
Create a fluid ingredient from the given fluid tag
|
static FluidIngredient |
of(int amount,
net.minecraft.util.ResourceLocation fluidId)
Create a fluid ingredient from the given fluid registry ID.
|
static FluidIngredient |
ofFluidStream(java.util.stream.Stream<FluidIngredient> stream)
Create a fluid ingredient from the given stream of other fluid ingredients.
|
boolean |
test(net.minecraft.item.ItemStack stack)
Test the given item against this ingredient.
|
boolean |
testFluid(net.minecraft.fluid.Fluid fluid)
Test the given fluid against this ingredient.
|
boolean |
testFluid(net.minecraftforge.fluids.FluidStack fluidStack)
Test the given fluid stack against this ingredient.
|
com.google.gson.JsonElement |
toJson() |
fromJson, fromNetwork, fromValues, getStackingIds, invalidate, invalidateAll, isSimple, isVanilla, merge, of, of, of, of, toNetwork, valueFromJsonpublic static final FluidIngredient EMPTY
protected FluidIngredient(java.util.List<net.minecraft.fluid.Fluid> fluids,
int amount,
net.minecraft.util.ResourceLocation fluidId,
net.minecraft.tags.ITag<net.minecraft.fluid.Fluid> fluidTag,
net.minecraft.nbt.CompoundNBT nbt,
boolean fuzzyNBT)
public static FluidIngredient of(net.minecraftforge.fluids.FluidStack fluidStack)
fluidStack - the fluidstack to match againstpublic static FluidIngredient of(int amount, @Nullable net.minecraft.nbt.CompoundNBT nbt, boolean fuzzyNBT, net.minecraft.fluid.Fluid... fluids)
amount - the amount, in mBnbt - the NBT, or null for no NBT matchingfuzzyNBT - true for a fuzzy match (only fields in the ingredient will be matched), false for an exact match.
Ignored if the nbt parameter is null.fluids - the list of fluidspublic static FluidIngredient of(int amount, net.minecraft.fluid.Fluid... fluids)
amount - the amount, in mBfluids - the list of fluidspublic static FluidIngredient of(int amount, @Nullable net.minecraft.nbt.CompoundNBT nbt, boolean fuzzyNBT, net.minecraft.tags.ITag<net.minecraft.fluid.Fluid> fluidTag)
amount - the amount, in mBnbt - the NBT, or null for no NBT matchingfuzzyNBT - true for a fuzzy match (only fields in the ingredient will be matched), false for an exact match.
Ignored if the nbt parameter is null.fluidTag - the fluid tagpublic static FluidIngredient of(int amount, net.minecraft.tags.ITag<net.minecraft.fluid.Fluid> fluidTag)
amount - the amount, in mBfluidTag - the fluid tagpublic static FluidIngredient of(int amount, @Nullable net.minecraft.nbt.CompoundNBT nbt, boolean fuzzyNBT, net.minecraft.util.ResourceLocation fluidId)
amount - the amount, in mBnbt - the NBT, or null for no NBT matchingfuzzyNBT - true for a fuzzy match (only fields in the ingredient will be matched), false for an exact match.
Ignored if the nbt parameter is null.fluidId - the fluid's registry IDpublic static FluidIngredient of(int amount, net.minecraft.util.ResourceLocation fluidId)
amount - the amount, in mBfluidId - the fluid's registry IDpublic static FluidIngredient ofFluidStream(java.util.stream.Stream<FluidIngredient> stream)
stream - a stream of ingredientsIngredient.of(Stream)protected java.util.Collection<net.minecraft.fluid.Fluid> getFluidList()
public boolean isEmpty()
isEmpty in class net.minecraft.item.crafting.Ingredientpublic boolean test(@Nullable
net.minecraft.item.ItemStack stack)
CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY capability) containing fluid which matches
this ingredient, AND it must be a container item
(IForgeItem.hasContainerItem(ItemStack) must return true).test in interface java.util.function.Predicate<net.minecraft.item.ItemStack>test in class net.minecraft.item.crafting.Ingredientstack - the itemstack to testpublic net.minecraft.item.ItemStack[] getItems()
getItems in class net.minecraft.item.crafting.Ingredientpublic boolean testFluid(net.minecraftforge.fluids.FluidStack fluidStack)
fluidStack - the fluid stack to testpublic boolean testFluid(net.minecraft.fluid.Fluid fluid)
fluid - the fluid to testpublic com.google.gson.JsonElement toJson()
toJson in class net.minecraft.item.crafting.Ingredientpublic net.minecraftforge.common.crafting.IIngredientSerializer<? extends net.minecraft.item.crafting.Ingredient> getSerializer()
getSerializer in class net.minecraft.item.crafting.Ingredientpublic int getAmount()
public java.util.List<net.minecraftforge.fluids.FluidStack> getFluidStacks()