Skip to content

CrTLiquidHandler

youyihj edited this page Jan 8, 2022 · 1 revision

CrTLiquidHandler

@since 1.9.8

CrTILiquidHandler handles fluids in machines and fluid tanks.

Importing the package

You'd better import the package to avoid errors and write script easier.

import mods.zenutils.LiquidHandler;

Getting an instance

  • world.getLiquidHandler(IBlockPos pos, @Optional IFacing facing) get liquid handler from Tile entity's container.

ZenGetters

tankProperties getter returns a List<ILiquidTankProperties>. The list contains the read-only information about the liquid handler.

ZenMethods

Drains fluid out of internal tanks, distribution is left entirely to the IFluidHandler. This method is not Fluid-sensitive.

Parameters:

  • maxDrain Maximum amount of fluid to drain.
  • doDrain If false, drain will only be simulated.

returns an ILiquidStack representing the Fluid and amount that was (or would have been, if simulated) drained.

ILiquidStack drain(int maxDrain, boolean doDrain)

Drains fluid out of internal tanks, distribution is left entirely to the IFluidHandler.

Parameters:

  • resource ILiquidStack representing the Fluid and maximum amount of fluid to be drained.
  • doDrain If false, drain will only be simulated.

returns an ILiquidStack representing the Fluid and amount that was (or would have been, if simulated) drained.

ILiquidStack drain(ILiquidStack resource, boolean doDrain)

Drains fluid out of internal tanks, distribution is left entirely to the IFluidHandler. This method is not Fluid-sensitive.

Parameters:

  • maxDrain Maximum amount of fluid to drain.
  • doDrain If false, drain will only be simulated. returns an ILiquidStack representing the Fluid and amount that was (or would have been, if simulated) drained.

int fill(ILiquidStack resource, boolean doFill)

Clone this wiki locally