Fix canFill/canDrain in tanks

This commit is contained in:
Prototik 2014-05-21 13:29:17 +08:00
parent 5be1d6031e
commit aa24a99d95

View file

@ -248,12 +248,14 @@ public class TileTank extends TileBuildCraft implements IFluidHandler {
@Override
public boolean canFill(ForgeDirection from, Fluid fluid) {
return true;
Fluid tankFluid = getBottomTank().tank.getFluidType();
return tankFluid == null || tankFluid == fluid;
}
@Override
public boolean canDrain(ForgeDirection from, Fluid fluid) {
return false;
Fluid tankFluid = getBottomTank().tank.getFluidType();
return tankFluid != null && tankFluid == fluid;
}
public int getFluidLightLevel() {