Class ExpandIFluidHandler

java.lang.Object
com.blamejared.crafttweaker.natives.capability.ExpandIFluidHandler

@ZenRegister public class ExpandIFluidHandler extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    drain(net.minecraftforge.fluids.capability.IFluidHandler internal, int maxDrain, net.minecraftforge.fluids.capability.IFluidHandler.FluidAction action)
    Drains fluid out of the internal tanks.
    drain(net.minecraftforge.fluids.capability.IFluidHandler internal, IFluidStack resource, net.minecraftforge.fluids.capability.IFluidHandler.FluidAction action)
    Drains fluid out of the internal tanks.
    static int
    fill(net.minecraftforge.fluids.capability.IFluidHandler internal, IFluidStack resource, net.minecraftforge.fluids.capability.IFluidHandler.FluidAction action)
    Fills the internal tanks with the given fluid.
    getFluidInTank(net.minecraftforge.fluids.capability.IFluidHandler internal, int tank)
    Gets the fluid in the given tank.
    static int
    getTankCapacity(net.minecraftforge.fluids.capability.IFluidHandler internal, int tank)
    Gets the capacity of the given tank.
    static int
    getTanks(net.minecraftforge.fluids.capability.IFluidHandler internal)
    Gets the number of tanks in this fluid handler.
    static boolean
    isFluidValid(net.minecraftforge.fluids.capability.IFluidHandler internal, int tank, IFluidStack stack)
    Checks if the given fluid is valid for the given tank.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ExpandIFluidHandler

      public ExpandIFluidHandler()
  • Method Details

    • getTanks

      public static int getTanks(net.minecraftforge.fluids.capability.IFluidHandler internal)
      Gets the number of tanks in this fluid handler.

      A single handler can have many tanks holding different fluids

      Returns:
      The number of tanks in this fluid handler.
    • getFluidInTank

      public static IFluidStack getFluidInTank(net.minecraftforge.fluids.capability.IFluidHandler internal, int tank)
      Gets the fluid in the given tank.
      Parameters:
      tank - The tank to get the fluid of.
      Returns:
      The fluid in the tank.
      DocParam:
      tank 0
    • getTankCapacity

      public static int getTankCapacity(net.minecraftforge.fluids.capability.IFluidHandler internal, int tank)
      Gets the capacity of the given tank.
      Parameters:
      tank - The tank to get the capacity of.
      Returns:
      The capacity of the given tank.
      DocParam:
      tank 0
    • isFluidValid

      public static boolean isFluidValid(net.minecraftforge.fluids.capability.IFluidHandler internal, int tank, IFluidStack stack)
      Checks if the given fluid is valid for the given tank.
      Parameters:
      tank - The tank to check.
      stack - The fluid to check.
      Returns:
      true if the fluid is valid, false otherwise.
      DocParam:
      tank 0, stack <fluid:minecraft:water>
    • fill

      public static int fill(net.minecraftforge.fluids.capability.IFluidHandler internal, IFluidStack resource, net.minecraftforge.fluids.capability.IFluidHandler.FluidAction action)
      Fills the internal tanks with the given fluid.
      Parameters:
      resource - The fluid to fill.
      action - Determines if the fill is simulated or executed.
      Returns:
      The amount of the fluid that will be used by the fill.
      DocParam:
      resource <fluid:minecraft:water>, action <constant:forge:fluid_action:execute>
    • drain

      public static IFluidStack drain(net.minecraftforge.fluids.capability.IFluidHandler internal, IFluidStack resource, net.minecraftforge.fluids.capability.IFluidHandler.FluidAction action)
      Drains fluid out of the internal tanks.
      Parameters:
      resource - The fluid and the maximum amount of the fluid to drain.
      action - Determines if the drain is simulated or executed.
      Returns:
      A new FluidStack representing the fluid that was drained along with how much was drained.
      DocParam:
      resource <fluid:minecraft:water> * 400, action <constant:forge:fluid_action:execute>
    • drain

      public static IFluidStack drain(net.minecraftforge.fluids.capability.IFluidHandler internal, int maxDrain, net.minecraftforge.fluids.capability.IFluidHandler.FluidAction action)
      Drains fluid out of the internal tanks.
      Parameters:
      maxDrain - How much fluid should be drained.
      action - Determines if the drain is simulated or executed.
      Returns:
      A new FluidStack representing the fluid that was drained along with how much was drained.
      DocParam:
      maxDrain 400, action <constant:forge:fluid_action:execute>