Class FluidIngredient

java.lang.Object
com.simibubi.create.foundation.fluid.FluidIngredient
All Implemented Interfaces:
Predicate<net.minecraftforge.fluids.FluidStack>
Direct Known Subclasses:
FluidIngredient.FluidStackIngredient, FluidIngredient.FluidTagIngredient

public abstract class FluidIngredient extends Object implements Predicate<net.minecraftforge.fluids.FluidStack>
  • Field Details

    • EMPTY

      public static final FluidIngredient EMPTY
    • matchingFluidStacks

      public List<net.minecraftforge.fluids.FluidStack> matchingFluidStacks
    • amountRequired

      protected int amountRequired
  • Constructor Details

    • FluidIngredient

      public FluidIngredient()
  • Method Details

    • fromTag

      public static FluidIngredient fromTag(net.minecraft.tags.TagKey<net.minecraft.world.level.material.Fluid> tag, int amount)
    • fromFluid

      public static FluidIngredient fromFluid(net.minecraft.world.level.material.Fluid fluid, int amount)
    • fromFluidStack

      public static FluidIngredient fromFluidStack(net.minecraftforge.fluids.FluidStack fluidStack)
    • testInternal

      protected abstract boolean testInternal(net.minecraftforge.fluids.FluidStack t)
    • readInternal

      protected abstract void readInternal(net.minecraft.network.FriendlyByteBuf buffer)
    • writeInternal

      protected abstract void writeInternal(net.minecraft.network.FriendlyByteBuf buffer)
    • readInternal

      protected abstract void readInternal(com.google.gson.JsonObject json)
    • writeInternal

      protected abstract void writeInternal(com.google.gson.JsonObject json)
    • determineMatchingFluidStacks

      protected abstract List<net.minecraftforge.fluids.FluidStack> determineMatchingFluidStacks()
    • getRequiredAmount

      public int getRequiredAmount()
    • getMatchingFluidStacks

      public List<net.minecraftforge.fluids.FluidStack> getMatchingFluidStacks()
    • test

      public boolean test(net.minecraftforge.fluids.FluidStack t)
      Specified by:
      test in interface Predicate<net.minecraftforge.fluids.FluidStack>
    • write

      public void write(net.minecraft.network.FriendlyByteBuf buffer)
    • read

      public static FluidIngredient read(net.minecraft.network.FriendlyByteBuf buffer)
    • serialize

      public com.google.gson.JsonObject serialize()
    • isFluidIngredient

      public static boolean isFluidIngredient(@Nullable com.google.gson.JsonElement je)
    • deserialize

      public static FluidIngredient deserialize(@Nullable com.google.gson.JsonElement je)