You're probably going to want to use a GuiHandler. Here's a base to start off with.
public class GuiHandler implements IGuiHandler{
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
/**
* Check IDs here, return container
**/
return null;
}
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int {
/**
* Check IDs here, return GUI
**/
return null;
}
}
When you use player.openGui(...), the one of the parameters is an integer ID. In the GuiHandler, you're going to want to check the ID passed in through parameters against a reference GUI ID. This is how the game knows which GUI to open.
As a reference, you can check out the source of my mod here. It's for 1.8, but it should still be applicable for 1.7.10 if memory serves correctly.