Package net.minecraftforge.fluids
Interface IFluidTank
-
- All Known Implementing Classes:
FluidTank
public interface IFluidTank
This interface represents a Fluid Tank. IT IS NOT REQUIRED but is provided for convenience. You are free to handle Fluids in any way that you wish - this is simply an easy default way. DO NOT ASSUME that these objects are used internally in all cases.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FluidStack
drain(int maxDrain, IFluidHandler.FluidAction action)
FluidStack
drain(FluidStack resource, IFluidHandler.FluidAction action)
int
fill(FluidStack resource, IFluidHandler.FluidAction action)
int
getCapacity()
FluidStack
getFluid()
int
getFluidAmount()
boolean
isFluidValid(FluidStack stack)
-
-
-
Method Detail
-
getFluid
@Nonnull FluidStack getFluid()
- Returns:
- FluidStack representing the fluid in the tank, null if the tank is empty.
-
getFluidAmount
int getFluidAmount()
- Returns:
- Current amount of fluid in the tank.
-
getCapacity
int getCapacity()
- Returns:
- Capacity of this fluid tank.
-
isFluidValid
boolean isFluidValid(FluidStack stack)
- Parameters:
stack
- Fluidstack holding the Fluid to be queried.- Returns:
- If the tank can hold the fluid (EVER, not at the time of query).
-
fill
int fill(FluidStack resource, IFluidHandler.FluidAction action)
- Parameters:
resource
- FluidStack attempting to fill the tank.action
- If SIMULATE, the fill will only be simulated.- Returns:
- Amount of fluid that was accepted (or would be, if simulated) by the tank.
-
drain
@Nonnull FluidStack drain(int maxDrain, IFluidHandler.FluidAction action)
- Parameters:
maxDrain
- Maximum amount of fluid to be removed from the container.action
- If SIMULATE, the drain will only be simulated.- Returns:
- Amount of fluid that was removed (or would be, if simulated) from the tank.
-
drain
@Nonnull FluidStack drain(FluidStack resource, IFluidHandler.FluidAction action)
- Parameters:
resource
- Maximum amount of fluid to be removed from the container.action
- If SIMULATE, the drain will only be simulated.- Returns:
- FluidStack representing fluid that was removed (or would be, if simulated) from the tank.
-
-