public class SingleUseTank extends Tank
setAcceptedFluid(Fluid).
Based on the Buildcraft SingleUseTank.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NBT_ACCEPTED_FLUID
The NBT name for the fluid tank.
|
protected EvilCraftTileEntity |
tile |
| Constructor and Description |
|---|
SingleUseTank(java.lang.String name,
int capacity,
EvilCraftTileEntity tile)
Make a new tank instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canCompletelyFill(net.minecraftforge.fluids.FluidStack fluidStack)
If this tank can completely contain the given fluid.
|
boolean |
canTankAccept(net.minecraftforge.fluids.Fluid fluid)
If this tank can accept the given fluid.
|
net.minecraftforge.fluids.FluidStack |
drain(int maxDrain,
boolean doDrain) |
int |
fill(net.minecraftforge.fluids.FluidStack resource,
boolean doFill) |
net.minecraftforge.fluids.Fluid |
getAcceptedFluid()
Get the accepted fluid for this tank.
|
void |
readTankFromNBT(net.minecraft.nbt.NBTTagCompound nbt)
Read the tank contents from NBT.
|
void |
reset()
Reset the tank by setting the inner fluid to null.
|
protected void |
sendUpdate() |
void |
setAcceptedFluid(net.minecraftforge.fluids.Fluid fluid)
Set the accepted fluid for this tank.
|
void |
writeTankToNBT(net.minecraft.nbt.NBTTagCompound nbt)
Write the tank contents to NBT.
|
getFluidType, getName, isEmpty, isFull, readFromNBT, replaceInnerFluid, writeToNBTpublic static final java.lang.String NBT_ACCEPTED_FLUID
protected EvilCraftTileEntity tile
public SingleUseTank(java.lang.String name,
int capacity,
EvilCraftTileEntity tile)
name - The name for the tank, will be used for NBT storage.capacity - The capacity (mB) for the tank.tile - The TileEntity that uses this tank.public int fill(net.minecraftforge.fluids.FluidStack resource,
boolean doFill)
fill in interface net.minecraftforge.fluids.IFluidTankfill in class net.minecraftforge.fluids.FluidTankpublic net.minecraftforge.fluids.FluidStack drain(int maxDrain,
boolean doDrain)
drain in interface net.minecraftforge.fluids.IFluidTankdrain in class net.minecraftforge.fluids.FluidTankprotected void sendUpdate()
public void reset()
public void setAcceptedFluid(net.minecraftforge.fluids.Fluid fluid)
fluid - The accepted fluidpublic net.minecraftforge.fluids.Fluid getAcceptedFluid()
public void writeTankToNBT(net.minecraft.nbt.NBTTagCompound nbt)
TankwriteTankToNBT in class Tanknbt - The NBT tag to write to.public void readTankFromNBT(net.minecraft.nbt.NBTTagCompound nbt)
TankreadTankFromNBT in class Tanknbt - The NBT tag to write from.public boolean canTankAccept(net.minecraftforge.fluids.Fluid fluid)
fluid - The fluid that needs to be checked.public boolean canCompletelyFill(net.minecraftforge.fluids.FluidStack fluidStack)
fluidStack - The fluid to try to fill.