Class IngredientSerializerFluidStack

java.lang.Object
org.cyclops.commoncapabilities.ingredient.IngredientSerializerFluidStack
All Implemented Interfaces:
IIngredientSerializer<net.neoforged.neoforge.fluids.FluidStack,Integer>

public class IngredientSerializerFluidStack extends Object implements IIngredientSerializer<net.neoforged.neoforge.fluids.FluidStack,Integer>
Serializer for FluidStacks.
  • Constructor Details

    • IngredientSerializerFluidStack

      public IngredientSerializerFluidStack()
  • Method Details

    • serializeInstance

      public net.minecraft.nbt.Tag serializeInstance(net.minecraft.core.HolderLookup.Provider lookupProvider, net.neoforged.neoforge.fluids.FluidStack instance)
      Description copied from interface: IIngredientSerializer
      Serialize an instance to NBT.
      Specified by:
      serializeInstance in interface IIngredientSerializer<net.neoforged.neoforge.fluids.FluidStack,Integer>
      Parameters:
      lookupProvider - The holder lookup provider.
      instance - An instance.
      Returns:
      An NBT tag.
    • deserializeInstance

      public net.neoforged.neoforge.fluids.FluidStack deserializeInstance(net.minecraft.core.HolderLookup.Provider lookupProvider, net.minecraft.nbt.Tag tag) throws IllegalArgumentException
      Description copied from interface: IIngredientSerializer
      Deserialize an instance from NBT.
      Specified by:
      deserializeInstance in interface IIngredientSerializer<net.neoforged.neoforge.fluids.FluidStack,Integer>
      Parameters:
      lookupProvider - The holder lookup provider.
      tag - An NBT tag.
      Returns:
      An instance.
      Throws:
      IllegalArgumentException - If the given tag is invalid or does not contain data on the given instance.
    • serializeCondition

      public net.minecraft.nbt.Tag serializeCondition(Integer matchCondition)
      Description copied from interface: IIngredientSerializer
      Serialize a match condition to NBT.
      Specified by:
      serializeCondition in interface IIngredientSerializer<net.neoforged.neoforge.fluids.FluidStack,Integer>
      Parameters:
      matchCondition - A match condition.
      Returns:
      An NBT tag.
    • deserializeCondition

      public Integer deserializeCondition(net.minecraft.nbt.Tag tag) throws IllegalArgumentException
      Description copied from interface: IIngredientSerializer
      Deserialize a match condition from NBT.
      Specified by:
      deserializeCondition in interface IIngredientSerializer<net.neoforged.neoforge.fluids.FluidStack,Integer>
      Parameters:
      tag - An NBT tag.
      Returns:
      A match condition.
      Throws:
      IllegalArgumentException - If the given tag is invalid or does not contain data on the given match condition.