public class EmptyFluidHandler extends java.lang.Object implements IFluidHandler
IFluidHandler.FluidAction
Modifier and Type | Field and Description |
---|---|
static EmptyFluidHandler |
INSTANCE |
Modifier | Constructor and Description |
---|---|
protected |
EmptyFluidHandler() |
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.
|
public static final EmptyFluidHandler INSTANCE
public int getTanks()
IFluidHandler
getTanks
in interface IFluidHandler
@Nonnull public FluidStack getFluidInTank(int tank)
IFluidHandler
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
getFluidInTank
in interface IFluidHandler
tank
- Tank to query.public int getTankCapacity(int tank)
IFluidHandler
getTankCapacity
in interface IFluidHandler
tank
- Tank to query.public boolean isFluidValid(int tank, @Nonnull FluidStack stack)
IFluidHandler
isFluidValid
in interface IFluidHandler
tank
- Tank to query for validitystack
- Stack to test with for validitypublic int fill(FluidStack resource, IFluidHandler.FluidAction action)
IFluidHandler
fill
in interface IFluidHandler
resource
- FluidStack representing the Fluid and maximum amount of fluid to be filled.action
- If SIMULATE, fill will only be simulated.@Nonnull public FluidStack drain(FluidStack resource, IFluidHandler.FluidAction action)
IFluidHandler
drain
in interface IFluidHandler
resource
- FluidStack representing the Fluid and maximum amount of fluid to be drained.action
- If SIMULATE, drain will only be simulated.@Nonnull public FluidStack drain(int maxDrain, IFluidHandler.FluidAction action)
IFluidHandler
drain
in interface IFluidHandler
maxDrain
- Maximum amount of fluid to drain.action
- If SIMULATE, drain will only be simulated.