public interface IFluidHandler
IFluidTank
objects.
A reference implementation is provided TileFluidHandler
.Modifier and Type | Interface and Description |
---|---|
static class |
IFluidHandler.FluidAction |
Modifier and Type | Method and Description |
---|---|
FluidStack |
drain(FluidStack resource,
IFluidHandler.FluidAction action)
Drains fluid out of internal tanks, distribution is left entirely to the IFluidHandler.
|
FluidStack |
drain(int maxDrain,
IFluidHandler.FluidAction action)
Drains fluid out of internal tanks, distribution is left entirely to the IFluidHandler.
|
int |
fill(FluidStack resource,
IFluidHandler.FluidAction action)
Fills fluid into internal tanks, distribution is left entirely to the IFluidHandler.
|
FluidStack |
getFluidInTank(int tank)
Returns the FluidStack in a given tank.
|
int |
getTankCapacity(int tank)
Retrieves the maximum fluid amount for a given tank.
|
int |
getTanks()
Returns the number of fluid storage units ("tanks") available
|
boolean |
isFluidValid(int tank,
FluidStack stack)
This function is a way to determine which fluids can exist inside a given handler.
|
int getTanks()
@Nonnull FluidStack getFluidInTank(int tank)
IMPORTANT: This FluidStack MUST NOT be modified. This method is not for altering internal contents. Any implementers who are able to detect modification via this method should throw an exception. It is ENTIRELY reasonable and likely that the stack returned here will be a copy.
SERIOUSLY: DO NOT MODIFY THE RETURNED FLUIDSTACK
tank
- Tank to query.int getTankCapacity(int tank)
tank
- Tank to query.boolean isFluidValid(int tank, @Nonnull FluidStack stack)
tank
- Tank to query for validitystack
- Stack to test with for validityint fill(FluidStack resource, IFluidHandler.FluidAction action)
resource
- FluidStack representing the Fluid and maximum amount of fluid to be filled.action
- If SIMULATE, fill will only be simulated.@Nonnull FluidStack drain(FluidStack resource, IFluidHandler.FluidAction action)
resource
- FluidStack representing the Fluid and maximum amount of fluid to be drained.action
- If SIMULATE, drain will only be simulated.@Nonnull FluidStack drain(int maxDrain, IFluidHandler.FluidAction action)
maxDrain
- Maximum amount of fluid to drain.action
- If SIMULATE, drain will only be simulated.