Class MCFluidStack

java.lang.Object
com.blamejared.crafttweaker.api.fluid.MCFluidStack
All Implemented Interfaces:
CommandStringDisplayable, IFluidStack

public class MCFluidStack extends Object implements IFluidStack
  • Constructor Details

    • MCFluidStack

      public MCFluidStack(net.minecraftforge.fluids.FluidStack fluidStack)
  • Method Details

    • isEmpty

      public boolean isEmpty()
      Description copied from interface: IFluidStack
      Gets whether this fluid stack is empty.
      Specified by:
      isEmpty in interface IFluidStack
      Returns:
      true if this stack is empty, false otherwise.
    • getAmount

      public long getAmount()
      Description copied from interface: IFluidStack
      Gets the fluid amount in MilliBuckets (mB).
      Specified by:
      getAmount in interface IFluidStack
      Returns:
      The amount of this fluid
    • setAmount

      public IFluidStack setAmount(int amount)
      Description copied from interface: IFluidStack
      Sets the fluid amount in MilliBuckets (mB)
      Specified by:
      setAmount in interface IFluidStack
      Parameters:
      amount - The amount to multiply this stack
      Returns:
      A new stack, or this stack, depending on if this stack is mutable
    • isImmutable

      public boolean isImmutable()
      Specified by:
      isImmutable in interface IFluidStack
    • getFluid

      public net.minecraft.world.level.material.Fluid getFluid()
      Description copied from interface: IFluidStack
      Retrieves this fluid stack's fluid.
      Specified by:
      getFluid in interface IFluidStack
      Returns:
      The fluid.
    • withTag

      public IFluidStack withTag(IData tag)
      Description copied from interface: IFluidStack
      Sets the tag for the FluidStack.
      Specified by:
      withTag in interface IFluidStack
      Parameters:
      tag - The tag to set.
      Returns:
      This FluidStack if it is mutable, a new one with the changed property otherwise
    • hasTag

      public boolean hasTag()
      Description copied from interface: IFluidStack
      Returns true if this FluidStack has a Tag
      Specified by:
      hasTag in interface IFluidStack
      Returns:
      true if tag is present.
    • getTag

      public IData getTag()
      Description copied from interface: IFluidStack
      Returns the NBT tag attached to this FluidStack.
      Specified by:
      getTag in interface IFluidStack
      Returns:
      MapData of the FluidStack's NBT Tag, null if it doesn't exist.
    • getInternal

      public net.minecraftforge.fluids.FluidStack getInternal()
      Description copied from interface: IFluidStack
      Gets the internal FluidStack that this IFluidStack is based on. On Forge, this will be a net.minecraftforge.fluids.FluidStack. On Fabric, this will be a com.blamejared.crafttweaker.impl.fluid.SimpleFluidStack You may need to specify the type in the call itself at times, like so iFluidStack.<FluidStack>getInternal().getFluid() or iFluidStack.<SimpleFluidStack>getInternal().fluid()
      Specified by:
      getInternal in interface IFluidStack
      Returns:
      The internal FluidStack that this IFluidStack is based on.
    • getImmutableInternal

      public net.minecraftforge.fluids.FluidStack getImmutableInternal()
      Description copied from interface: IFluidStack
      Gets a copy of the internal FluidStack that this IFluidStack is based on. On Forge, this will be a net.minecraftforge.fluids.FluidStack. On Fabric, this will be a com.blamejared.crafttweaker.impl.fluid.SimpleFluidStack You may need to specify the type in the call itself at times, like so iFluidStack.<FluidStack>getInternal().getFluid() or iFluidStack.<SimpleFluidStack>getInternal().fluid()
      Specified by:
      getImmutableInternal in interface IFluidStack
      Returns:
      A copy of the FluidStack that this IFluidStack is based on.
    • asIData

      public IData asIData()
      Specified by:
      asIData in interface IFluidStack
    • getInternalTag

      public net.minecraft.nbt.CompoundTag getInternalTag()
      Specified by:
      getInternalTag in interface IFluidStack
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object