Hello,
after a conversation with diesieben07 (http://www.minecraftforge.net/forum/index.php/topic,39068.0.html) we noticed that its kind of difficult to get the current villager trade. I want it to work even if the player hasnt put in any items, so ContainerMerchant#getMerchantInventory().getCurrentRecipe() wont work. Maybe its possible to use the MerchantRecipeList or InventoryMerchant#currentRecipeIndex.
It just crossed my mind that maybe the GuiMerchant class holds useful information.
Slightly modified code:
//The integer value corresponding to the currently selected merchant recipe.
private int selectedMerchantRecipe;
MerchantRecipe merchantrecipe = (MerchantRecipe)merchantrecipelist.get(selectedMerchantRecipe);
Could this be used?