IFluidHandler
Importing the class
If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.
import crafttweaker.api.capability.IFluidHandler;
Operators
// IFluidHandler[tank as int] as IFluidStackmyIFluidHandler[myInt]
Parameters:
tank: int
Type: int
- The tank to get the fluid of.
Return Type:
IFluidStack
Members
Returns: A new FluidStack representing the fluid that was drained along with how much was drained.
myIFluidHandler.drain(<fluid:minecraft:water> * 400, <constant:neoforge:fluid_action:execute>);
Parameters:
action: IFluidHandlerAction
Type: IFluidHandlerAction
- Determines if the drain is simulated or executed.
Return Type:
IFluidStack
Returns: A new FluidStack representing the fluid that was drained along with how much was drained.
myIFluidHandler.drain(400, <constant:neoforge:fluid_action:execute>);
Parameters:
maxDrain: int
Type: int
- How much fluid should be drained. action: IFluidHandlerAction
Type: IFluidHandlerAction
- Determines if the drain is simulated or executed.
Return Type:
IFluidStack
Returns: The amount of the fluid that will be used by the fill.
myIFluidHandler.fill(<fluid:minecraft:water>, <constant:neoforge:fluid_action:execute>);
Parameters:
action: IFluidHandlerAction
Type: IFluidHandlerAction
- Determines if the fill is simulated or executed.
Return Type:
int
Returns: The fluid in the tank.
myIFluidHandler.getFluidInTank(0);
Parameters:
tank: int
Type: int
- The tank to get the fluid of.
Return Type:
IFluidStack
Returns: The capacity of the given tank.
// IFluidHandler.getTankCapacity(tank as int) as int;myIFluidHandler.getTankCapacity(0);
Parameters:
tank: int
Type: int
- The tank to get the capacity of.
Return Type:
int
Returns: true if the fluid is valid, false otherwise.
myIFluidHandler.isFluidValid(0, <fluid:minecraft:water>);
Parameters:
tank: int
Type: int
- The tank to check.
Return Type:
bool
A single handler can have many tanks holding different fluids
// IFluidHandler.tanks as intmyIFluidHandler.tanks
Return Type:
int