Interface FluidStack

All Superinterfaces:
CopyableDataHolder, DataHolder, DataHolder.Mutable, DataSerializable, SerializableDataHolder, SerializableDataHolder.Mutable, ValueContainer

public interface FluidStack extends SerializableDataHolder.Mutable
Represents a stack of a particular FluidType and volume measured in "milliBuckets" where 1000mB is equal to 1 ItemTypes.BUCKET.
  • Method Details

    • builder

      static FluidStack.Builder builder()
      Creates a new FluidStack.Builder to make fluid stacks.
      Returns:
      The newly created builder
    • fluid

      FluidType fluid()
      Gets the FluidType for this fluid stack.
      Returns:
      The fluid type of this stack
    • volume

      int volume()
      Gets the "volume" of this FluidStack.

      Note that the volume is measured in "milli buckets", otherwise read as mB. The scaling is as follows: 1 bucket = 1000mB, whereas 1 block usually equals 1000mB.

      Returns:
      The volume in milli buckets
    • setVolume

      FluidStack setVolume(int volume)
      Sets the desired volume for this stack.

      Note that the volume is measured in "milli buckets", otherwise read as mB. The scaling is as follows: 1 bucket = 1000mB, whereas 1 block usually equals 1000mB.

      Parameters:
      volume - The volume to set
      Returns:
      This fluid stack
    • createSnapshot

      FluidStackSnapshot createSnapshot()
      Creates a snapshot of this FluidStack.
      Returns:
      The fluid stack snapshot
    • copy

      FluidStack copy()
      Description copied from interface: CopyableDataHolder
      Creates a clone copy of this CopyableDataHolder as a new CopyableDataHolder such that all the Values are safely duplicated to the new instance. It is not guaranteed that the returning container is of the same type as this container.
      Specified by:
      copy in interface CopyableDataHolder
      Specified by:
      copy in interface SerializableDataHolder
      Specified by:
      copy in interface SerializableDataHolder.Mutable
      Returns:
      The new copy