public interface IFluidHandler
IFluidTank
objects.
A reference implementation is provided TileFluidHandler
.Modifier and Type | Method and Description |
---|---|
boolean |
canDrain(EnumFacing from,
Fluid fluid)
Returns true if the given fluid can be extracted from the given direction.
|
boolean |
canFill(EnumFacing from,
Fluid fluid)
Returns true if the given fluid can be inserted into the given direction.
|
FluidStack |
drain(EnumFacing from,
FluidStack resource,
boolean doDrain)
Drains fluid out of internal tanks, distribution is left entirely to the IFluidHandler.
|
FluidStack |
drain(EnumFacing from,
int maxDrain,
boolean doDrain)
Drains fluid out of internal tanks, distribution is left entirely to the IFluidHandler.
|
int |
fill(EnumFacing from,
FluidStack resource,
boolean doFill)
Fills fluid into internal tanks, distribution is left entirely to the IFluidHandler.
|
FluidTankInfo[] |
getTankInfo(EnumFacing from)
Returns an array of objects which represent the internal tanks.
|
int fill(EnumFacing from, FluidStack resource, boolean doFill)
from
- Orientation the Fluid is pumped in from.resource
- FluidStack representing the Fluid and maximum amount of fluid to be filled.doFill
- If false, fill will only be simulated.FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain)
from
- Orientation the Fluid is drained to.resource
- FluidStack representing the Fluid and maximum amount of fluid to be drained.doDrain
- If false, drain will only be simulated.FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain)
from
- Orientation the fluid is drained to.maxDrain
- Maximum amount of fluid to drain.doDrain
- If false, drain will only be simulated.boolean canFill(EnumFacing from, Fluid fluid)
boolean canDrain(EnumFacing from, Fluid fluid)
FluidTankInfo[] getTankInfo(EnumFacing from)
FluidTankInfo
.from
- Orientation determining which tanks should be queried.