Let me make this as copy-paste friendly, as you want it, served warm and fresh:
@Override
public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn,
EnumHand hand) {
playerIn.openGui(Main.instance, GuiHandler.TEST_BAG, worldIn, playerIn.getPos().getX(), playerIn.getPos().getY(), playerIn.getPos().getZ());
return super.onItemRightClick(itemStackIn, worldIn, playerIn, hand);
}