State representation
In the 8Puzzle the state of each step in the solution is an array of tiles. In the water jug it can be an array of jug levels [0,0]
You can replace tiles with jugs TILE tiles[ BOARD_WIDTH*BOARD_HEIGHT ]; int jug_levels[ 2 ];
State transitions
Valid state transitions are encode in the function GetSuccessors
In the 8puzzle example a valid successor is worked out by figuring which tiles can move. In your case the valid moves are all the combinations of emptying and filling each jug.
IsGoal will need to check that the 4 gallon jug has the correct level
GoalDistanceEstimate will return something that you decide. For example the difference in level between the 4 gallon jug and the goal level