Class FluidIngredient

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

public abstract sealed class FluidIngredient extends Object implements Predicate<net.neoforged.neoforge.fluids.FluidStack> permits FluidIngredient.FluidStackIngredient, FluidIngredient.FluidTagIngredient
  • Field Details

    • EMPTY

      public static final FluidIngredient EMPTY
    • CODEC

      public static final com.mojang.serialization.Codec<FluidIngredient> CODEC
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,FluidIngredient> STREAM_CODEC
    • matchingFluidStacks

      public List<net.neoforged.neoforge.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.neoforged.neoforge.fluids.FluidStack fluidStack)
    • getRequiredAmount

      public int getRequiredAmount()
    • testInternal

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

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

      protected abstract void writeInternal(net.minecraft.network.RegistryFriendlyByteBuf buffer)
    • determineMatchingFluidStacks

      protected abstract List<net.neoforged.neoforge.fluids.FluidStack> determineMatchingFluidStacks()
    • getType

      protected abstract FluidIngredient.Type getType()
    • getMatchingFluidStacks

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

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

      public static void write(net.minecraft.network.RegistryFriendlyByteBuf buffer, FluidIngredient ingredient)
    • read

      public static FluidIngredient read(net.minecraft.network.RegistryFriendlyByteBuf buffer)