IFluidHandler
Importing the class
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
Methods
Drains fluid out of the internal tanks.
Returns: A new FluidStack representing the fluid that was drained along with how much was drained.
Return Type: IFluidStack
Parameter | Type | Description |
---|---|---|
Parameter maxDrain | Type int | Description How much fluid should be drained. |
Parameter action | Type IFluidHandlerAction | Description Determines if the drain is simulated or executed. |
Drains fluid out of the internal tanks.
Returns: A new FluidStack representing the fluid that was drained along with how much was drained.
Return Type: IFluidStack
Parameter | Type | Description |
---|---|---|
Parameter resource | Type IFluidStack | Description The fluid and the maximum amount of the fluid to drain. |
Parameter action | Type IFluidHandlerAction | Description Determines if the drain is simulated or executed. |
Fills the internal tanks with the given fluid.
Returns: The amount of the fluid that will be used by the fill.
Return Type: int
Parameter | Type | Description |
---|---|---|
Parameter resource | Type IFluidStack | Description The fluid to fill. |
Parameter action | Type IFluidHandlerAction | Description Determines if the fill is simulated or executed. |
Gets the fluid in the given tank.
Returns: The fluid in the tank.
Return Type: IFluidStack
Parameter | Type | Description |
---|---|---|
Parameter tank | Type int | Description The tank to get the fluid of. |
Gets the capacity of the given tank.
Returns: The capacity of the given tank.
Return Type: int
Parameter | Type | Description |
---|---|---|
Parameter tank | Type int | Description The tank to get the capacity of. |
Checks if the given fluid is valid for the given tank.
Returns: true if the fluid is valid, false otherwise.
Return Type: boolean
Parameter | Type | Description |
---|---|---|
Parameter tank | Type int | Description The tank to check. |
Parameter stack | Type IFluidStack | Description The fluid to check. |
Properties
Name | Type | Has Getter | Has Setter | Description |
---|---|---|---|---|
Name tanks | Type int | Has Getter true | Has Setter false | Description Gets the number of tanks in this fluid handler. A single handler can have many tanks holding different fluids |